I'm using the AppServiceProvider to share specific admin data with all related views.
Now I'd like to share admin data also with all admin related Controllers to replace Auth::guard('admin')->user()->firstname by $admin->firstname
.
$id = Auth::guard('admin')->user()->id;
$admin = Admin::findOrFail($id)->first();
How can I share this piece of code with all related Controllers to get for example admin firstname
via $admin->firstname
?