/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $provinces = \App\Province::orderBy('title', 'asc')->select('id', 'title')->get(); $laHabanaId = count($provinces) ? $provinces->filter(function ($p) { return $p->title == 'La Habana'; })->first()->id : -1; $view->with('provinces', $provinces)->with('laHabanaId', $laHabanaId); }
public function getProvincialData() { $data = Province::orderBy('province', 'year')->get(); return View::make('vcms5::admin.provincial-data-list')->with('data', $data); }