Skip to content

Instantly share code, notes, and snippets.

@matbrgz
Created March 18, 2018 06:12
Show Gist options
  • Save matbrgz/2a2001e0aa77ceaa57da7219ef527b02 to your computer and use it in GitHub Desktop.
Save matbrgz/2a2001e0aa77ceaa57da7219ef527b02 to your computer and use it in GitHub Desktop.
Please review the setup details for notifications.
You will want to add things like:
These links:
<li><a href='{!! url('user/notifications') !!}'><span class='fa fa-envelope-o'></span> Notifications</a></li>
<li><a href='{!! url('admin/notifications') !!}'><span class='fa fa-envelope-o'></span> Notifications</a></li>
Now mofify the RouteServiceProvider by switching to a closure in the `group` method (app/Providers/RouteServiceProvider.php):
It will look like: ->group(base_path('routes/web.php')); So you need to change it to resemble this:
->group(function () {
require base_path('routes/web.php');
require base_path('routes/notification.php');
}
Add this to (app/Providers/AppServiceProvider.php) in the register() method:
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Notifications', \App\Facades\Notifications::class);
$this->app->singleton('NotificationService', function ($app) {
return app(\App\Services\NotificationService::class);
});
Finished setting up notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment