PHP code example of samkitano / laragrowl

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

    

samkitano / laragrowl example snippets


'providers' => [
    Kitano\Laragrowl\LaragrowlServiceProvider::class,
];

'aliases' => [
    'Notify' => Kitano\Laragrowl\Laragrowl::class,
];

<!DOCTYPE html>
<html>
    <head>
        ...
        <link href="path_to_your_downloaded_jGrowl_css_files" rel="stylesheet" type="text/css"/>
        ...
    </head>

    <body>
        ...
        <!-- Place jQuery Here -->
        <script src="path_to_your_downloaded_jGrowl_js_files"></script>
        ...
    </body>
</html>

<!DOCTYPE html>
<html>
    <head>
      ...
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.4.1/jquery.jgrowl.min.css" />
	  <!-- Place Your Theme Here -->
	  ...
    </head>

    <body>
        ...
        <!-- Place jQuery Here -->
        <script src="https//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.4.1/jquery.jgrowl.min.js"></script>
        ...
    </body>
</html>

<!DOCTYPE html>
<html>
    <head>
        <title>Laragrowl</title>
        <link href="{{ url('vendor/css/jquery.jgrowl.min.css') }}" rel="stylesheet" type="text/css">
        <link href="{{ url('vendor/css/jquery.jgrowl.theme.min.css') }}" rel="stylesheet" type="text/css">
    <head>

    <body>
        <script src="your.jquery.version.js"></script>
        <script src="{{ url('vendor/js/jquery.jgrowl.min.js') }}"></script>
    </body>

</html>

	<body>
		<script src="your.jquery.version"></script>
		<script src="{{ url('vendor/js/jquery.jgrowl.min.js) }}"></script>

		@

// Examples
public function store()
{
	...

	// PICK YOUR FLAVOUR

	// With an Alias, like "Notify"
	Notify::message('Your stuff has been stored.', 'success');

	// With the Facade
	Laragrowl::message('Your stuff has been stored', 'success');

	// Using available methods to declare the message type
	Laragrowl::default('Your stuff has been stored');
	Laragrowl::success('Your stuff has been stored');
	Laragrowl::error('Your stuff was NOT stored');
	Laragrowl::warning('Your form contains errors, check fields');
	Laragrowl::info('You have a neww message');

	...
}
bash
php artisan vendor:publish --provider="Kitano\Laragrowl\LaragrowlServiceProvider" --tag=assets
bash
php artisan vendor:publish --provider="Kitano\Laragrowl\LaragrowlServiceProvider" --tag=views