PHP code example of gloudemans / notify

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

    

gloudemans / notify example snippets


    $this->notification->success('Success notification');
    $this->notification->info('Info notification');
    $this->notification->warning('Warning notification');
    $this->notification->error('Error notification');


    use AddsNotifications;
    
    public function yourMethod()
    {
        $this->notify()->success(...); // Also info(), warning(), error()
        $this->notifySuccess(...);
        $this->notifyInfo(...);
        $this->notifyWarning(...);
        $this->notifyError(...);
    }


    /**
     * Render the notifications as HTML/JavaScript
     *
     * @param  array $notifications
     * @return string
     */
    public function render(array $notifications);

    $this->app->bind(
        'Gloudemans\Notify\Notifications\NotificationRenderer',
        'App\Renderers\MyCustomRenderer'
    );
 app('Gloudemans\Notify\Notifications\Notification')->render();