I am learning laravel coming from a codeigniter background. I have an object I need to get from a model to be used in the navigation bar. The call I'm making is this.
$users = \App\Models\User::all();
I know I can do this on every controller
public function index()
{
$users = \App\Models\User::all();
return View::make('users')->with('users', $users);
}
But I'm trying to get in good habits. What is the best practice for retrieving this data on every page in laravel 5?