I can access a function in every view like this.
In my AppServiceProvide Code
public function boot()
{
$post = Post::latest()->first();
View::share(compact('post'));
}
How can i access it in every controller?
What is the best way to call a function in every controller,as i need to make sure latest record from database.