jakjr / messenger
Simple package to flash generic messages
Installs: 11 468
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0.7
This package is not auto-updated.
Last update: 2024-11-19 15:52:13 UTC
README
A small package to display messages in a View.
-
composer require jakjr/messenger
-
Register the ServiceProvider (config/app.php)
'providers' => [
...
Jakjr\Messenger\MessengerServiceProvider::class,
],
- Register an Alias (config/app.php)
'aliases' => [
...
'Messenger' => Jakjr\Messenger\MessengerFacade::class,
),
- Controller use:
Messenger::success('Hello Word');
- View use:
@include('messenger::message'
-
You can publish the view and the config file: $ php artisan vendor:publish
-
To custom the view, make changes on file: resources/views/vendor/messenger/message.blade.php
-
To custom the configuratio, make changes on file: config/messenger.php
-
Or on runtime
Config::set('messenger.wrapper', "
<div class='alert alert-:status-class: alert-dismissible' role='alert'>
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>
:message:
</div>
");