PHP code example of carkii / notifier
1. Go to this page and download the library: Download carkii/notifier library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
carkii / notifier example snippets
'providers' => [
/*
//
other providers
//
*/
Carkii\Notifier\NotifierServiceProvider::class,
]
'aliases' => [
/*
//
other aliases
//
*/
'Notifier' => Carkii\Notifier\facades\Notifier::class,
]
artisan migrate
<meta name="csrf-token" content="{{ csrf_token() }}">
{!! Notifier::break(0,30,0)->get()->first() !!}
{!! Notifier::addStylesAndScriptes() !!}
// get list of notifications and diaply them as a list
// navbar
<nav class="navbar navbar-inverse">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Notifications
@if(Notifier::count())
<span class="badge background-myred notifications-counter">{{Notifier::count()}}</span>
@endif
<i class="fa fa-bell" aria-hidden="true"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
@if(Notifier::any())
@foreach(Notifier::get() AS $notification )
<li>{!! $notification !!}</li>
@endforeach
@else
<li class='text-center' >No Notifications</li>
@endif
</ul>
</li>
</nav>
//end of navbar
//end of your page's body
{!! Notifier::addStylesAndScriptes() !!}
config\app.php
php artisan vendor:publish
/resources/views/notifications/_ModalExample.blade.php
/resources/views/notifications/ModalExample.blade.php
/resources/views/notifications/_CardExample.blade.php
/resources/views/notifications/CardExample.blade.php