PHP code example of wegnermedia / informer

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

    

wegnermedia / informer example snippets


'providers' => [
    'Wegnermedia\Informer\InformerServiceProvider'
]

'aliases' => [
    'Informer' => 'Wegnermedia\Informer\Facades\Informer'
]



class CartController extends ShopController {

	/**
	 * Add Item to Cart.
	 *
	 * @return Response
	 */
	public function addItem()
	{
		// ... adding logic

		// Set the Success Message
		Informer::success('Nice', "You've added {$item->name} successfully to your cart." );

		// ... create the Response
		return Redirect::back();

	}

	/**
	 * Reset Cart.
	 *
	 * @return Response
	 */
	public function reset()
	{
		// Set a danger Message and make it modal as well ...
		Informer::danger('Attention', "You're about to delete your cart, you wish to proceed?", true);
	}

}