I'm looking for the best practise to implement user notifications in "app.blade.php" layout.
The Layout should always check for user notifications and I don't want to implement in every Controller.
Thanks for your ideas.
I'm looking for the best practise to implement user notifications in "app.blade.php" layout.
The Layout should always check for user notifications and I don't want to implement in every Controller.
Thanks for your ideas.
Asuming you don’t mean Notifications and your own implementation, then you’d want to use a View Composer:
Create a composer called UserNotificationComposer
or similar, add your logic to that, then create a ViewServiceProvider
and link them up:
View::composer(
'*', 'App\Http\View\Composers\UserNotificationComposer'
);
(This is asuming you’re using your own ‘user notifications’, if you’re using the Larvel Notifications, then you don’t need any logic in your controllers.)