PHP code example of andheiberg / notify

1. Go to this page and download the library: Download andheiberg/notify 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/ */

    

andheiberg / notify example snippets


Andheiberg\Notify\NotifyServiceProvider::class,

'Notify' => Andheiberg\Notify\Facades\Notify::class,

Notify::info('This is an info message.');
Notify::error('Whoops, something has gone wrong.');

Notify::success('auth.login-successful'); // Calls Lang::get('auth.login-successful') behind the scene
Notify::warning('auth.verification-email-sent', ['email' => '[email protected]']) // You can also pass replacements

@foreach (Notify::all() as $notification)
    {{ $notification }}
@endforeach

@if (Notify::has('success'))
    {{ Notify::first('success') }}
@endif

@if (Notify::all())
	<div class="container">
		@foreach (Notify::get('success') as $alert)
			<div class="alert alert-success">
				<button type="button" class="close" data-dismiss="alert">&times;</button>
				{{ $alert }}
			</div>
		@endforeach

		@foreach (Notify::get('error') as $alert)
			<div class="alert alert-danger">
				<button type="button" class="close" data-dismiss="alert">&times;</button>
				{{ $alert }}
			</div>
		@endforeach

		@foreach (Notify::get('info') as $alert)
			<div class="alert alert-info">
				<button type="button" class="close" data-dismiss="alert">&times;</button>
				{{ $alert }}
			</div>
		@endforeach

		@foreach (Notify::get('warning') as $alert)
			<div class="alert alert-warning">
				<button type="button" class="close" data-dismiss="alert">&times;</button>
				{{ $alert }}
			</div>
		@endforeach
	</div>
@endif
bash
# Laravel 4x
php artisan config:publish andheiberg/notify

# Laravel 5x
php artisan vendor:publish --provider="Andheiberg\Notify\NotifyServiceProvider"