PHP code example of jorgejavierleon / laravelpnotify
1. Go to this page and download the library: Download jorgejavierleon/laravelpnotify 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/ */
jorgejavierleon / laravelpnotify example snippets
public function store()
{
$user->save();
Notify::success('The user has been created');
return view('home')
}
//config/laravelPnotify
return [
/*
* The notice's title.
*/
'title' => false,
/*
* Whether to escape the content of the title. (Not allow HTML.)
*/
'title_escape' => false,
/*
* The notice's text.
*/
'text' => false,
/*
* Whether to escape the content of the text. (Not allow HTML.)
*/
'text_escape' => false,
/*
* What styling classes to use.
* Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", "fontawesome", or a custom style object.
* See the source in the end of pnotify.core.js for the properties in a style object.)
*/
'styling' => 'bootstrap3',
/*
* Additional classes to be added to the notice. (For custom styling.)
*/
'addclass' => '',
/*
* Class to be added to the notice for corner styling.
*/
'cornerclass' => '',
/*
* Display the notice when it is created.
* Turn this off to add notifications to the history without displaying them.
*/
'auto_display' => true,
/*
* Width of the notice
*/
'width' => '300px',
/*
* Minimum height of the notice. It will expand to fit content.
*/
'min_height' => '16px',
/*
* Type of the notice. "notice", "info", "success", or "error".
*/
'type' => 'notice',
/*
* Set icon to true to use the default icon for the selected style/type,
* false for no icon, or a string for your own icon class.
*/
'icon' => true,
/*
* The animation to use when displaying and hiding the notice.
* "none", "show", "fade", and "slide" are built in to jQuery.
* Others
Notify::info('notice with overrides')->override([
'animation' => 'slide',
'animate_speed' => 'normal',
])
class PagesControllerTest extends TestCase
{
use NotifiersHelpers;
/**
* @return void
*/
public function testHomePageGreetsTheUser()
{
$this->get('/home')
->seeNotificationType('success')
->seeNotificationBody('Hello There!');
}
}
bash
php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.