public function doSomething() { $weather = $this->forecast->get('50.0908', '14.4005'); //echo Auth::user()->name->hasRole('admin'); //fungujr //echo Auth::user()->hasRole('manager'); //funguje // echo Auth::user()->name; echo '<pre>'; print_r($weather); echo '</pre>'; //dd('$weather'); }
/** * Register the service provider. * * @return void */ public function register() { $this->registerConfiguration(); $this->app->singleton(Forecast::class, function () { $forecast = new Forecast(config('laravel-forecast.API_KEY')); if (!empty(config('laravel-forecast.options'))) { $forecast->setOptions(config('laravel-forecast.options')); } return $forecast; }); }