/** * Bootstrap any application services. * * @return void */ public function boot() { view()->composer('layouts.dashboard', function ($view) { $view->with('parcels', Parcels::all())->with('deliveredparcels', Parcels::take(5)->latest()->where('status_id', '=', 4)->get())->with('undeliveredparcels', Parcels::take(5)->latest()->where('status_id', '!=', 4)->get())->with('users', User::all()->count())->with('towns', Towns::all()->count())->with('shipments', ParcelsTowns::all()->count()); }); }