Download the PHP package dev-promtheus98/flashy without Composer
On this page you can find all versions of the php package dev-promtheus98/flashy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dev-promtheus98/flashy
More information about dev-promtheus98/flashy
Files in dev-promtheus98/flashy
Package flashy
Short Description Easy Flash Messages
License MIT
Homepage https://github.com/dev-promtheus98/flashy
Informations about the package flashy
Easy Flash Messages
Copyright
Inspired by mercuryseries Flash Package.
Installation
You like text ?
First, pull in the package through Composer.
Run composer require dev-promtheus98/flashy
Note that the package are been tests only on laravel 9
Usage
Within your controllers, before you perform a redirect...
You may also do:
Flashy::info('Message', 'http://your-awesome-link.com')
Flashy::success('Message', 'http://your-awesome-link.com')
Flashy::error('Message', 'http://your-awesome-link.com')
Flashy::warning('Message', 'http://your-awesome-link.com')
Flashy::primary('Message', 'http://your-awesome-link.com')
Flashy::primaryDark('Message', 'http://your-awesome-link.com')
Flashy::muted('Message', 'http://your-awesome-link.com')
Flashy::mutedDark('Message', 'http://your-awesome-link.com')
Again, if using Laravel, this will set a few keys in the session:
- 'flashy_notification.message' - The message you're flashing
- 'flashy_notification.type' - A string that represents the type of notification (good for applying HTML class names)
- 'flashy_notification.link' - The URL to redirect to on click
Alternatively, again, if you're using Laravel, you may reference the flashy()
helper function, instead of the facade. Here's an example:
Or, for a general information flash, just do: flashy('Some message', 'http://your-awesome-link.com');
.
With this message flashed to the session, you may now display it in your view(s). Maybe something like:
Because flash messages are so common, if you want, you may use (or modify) the views that are included with this package. Simply append to your layout view:
Note that this package has jQuery has dependency. It's also better to load flashy before your body close tag.
Example
If you need to modify the flash message partials, you can run:
The two package views will now be located in the app/views/packages/dev-promtheus98/flashy/
directory.
Nice rendering
For a nice rendering you may include these lines in your head:
and override the following sections of the default flashy view:
All versions of flashy with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^9.0|^10|^11