1. Go to this page and download the library: Download rayhan-bapari/notyfyre 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/ */
rayhan-bapari / notyfyre example snippets
namespace App\Http\Controllers;
use Illuminate\Http\Controller;
class ExampleController extends Controller
{
public function store()
{
// Using the helper function (only title needed)
notyfyre()->success('User created successfully!');
// Or using the Facade
\Notyfyre::error('Something went wrong!');
// Different notification types
notyfyre()->info('Information message');
notyfyre()->warning('Warning message');
notyfyre()->error('Error message');
notyfyre()->success('Success message');
// With custom options
notyfyre()->success('Custom notification', [
'position' => 'bottom-right',
'autoClose' => 5000,
'progress' => false
]);
return redirect()->back();
}
}
return [
'position' => 'top-center',
'auto_close' => 3000, // milliseconds, false to disable
'progress' => true, // Progress bar at bottom
'