setTimezone($tz)->format($format); } } if(!function_exists('findTrait')){ function findTrait($name){ return "\\App\\Traits\\{$name}"; } } if(!function_exists('getApiRequest')){ function getApiRequest($url){ $data = Illuminate\Support\Facades\Http::get($url); return $data->json(); } } if(!function_exists('findRowByColumn')){ function findRowByColumn($model,$columnName,$value){ $data = model($model)::where($columnName,$value)->first(); return $data; } } if(!function_exists('model')){ function model($name){ return "\\App\\Models\\{$name}"; } } if(!function_exists('flag_url')){ function flag_url($code, $size='1x1'){ //alt size 4x3 return asset("flags/{$size}/".strtolower($code).".svg"); } }