share('locales', config('translatable.locales')); view()->composer(['page._form'], function ($view) { $view->with('categories', [ '' => '', ]); }); view()->composer(['layouts.public'], function ($view) { $view->with('blocks', Block::upcoming()->lists('date')); }); view()->composer(['location._form'], function ($view) { $view->with('location_types', ['' => ''] + LocationType::all()->lists('title', 'id')->toArray()); }); view()->composer(['route._form', 'tour._form'], function ($view) { $view->with('locations', Location::orderBy('title')->get()->prepend('', '')); }); view()->composer(['price._form', 'price.create', 'price.edit'], function ($view) { $view->with('routes', ['' => ''] + Route::all()->sortBy('title')->lists('title', 'id')->toArray()); $view->with('vehicles', Vehicle::all()); }); view()->composer(['reservation._form', 'reservation.create'], function ($view) { $view->with('vehicles', ['' => ''] + Vehicle::all()->lists('title', 'title')->toArray()); $view->with('drivers', User::query() ->whereHas('roles', function ($query) { $query->where('name', 'driver'); }) ->orWhereHas('roles', function ($query) { $query->where('name', 'partner'); }) ->orderBy('name') ->lists('name', 'id') ->prepend('', '') ); $view->with('agencies', User::query() ->whereHas('roles', function ($query) { $query->where('name', 'agency'); }) ->orderBy('name') ->lists('name', 'id') ->prepend('', '') ); }); view()->composer(['user._form'], function ($view) { $view->with('roles', Role::lists('display_name', 'id')); }); view()->composer(['public.reservation', 'reservation._form', 'reservation.create'], function ($view) { $numbers = array_combine($r = range(0, 20), $r); $view->with('numbers', $numbers); }); view()->composer(['include.header'], function ($view) { $view->with('locations', Location::has('tours')->orderBy('title')->get()); }); Blade::directive('price_format', function ($expression) { return "(' . currency($expression, 'EUR', 'HRK') . ')' ; ?>"; }); } /** * Register any application services. * * @return void */ public function register() { // } }