Closed jacurtis closed 7 years ago
Ok so i set these up with variable parameters. This will need to go into the documentation.
I will use info()
as an example, but this applies to any of them, the difference being that it changes the type to whichever function you are using.
info()
- no parameters will only work as a chained method and sets the current Notification to this notification type. So for example LaraFlash::new()->content('There was a problem')->warning();
LaraFlash::info(String $content | Array $options)
- one param will be treated as an $options
array if an array is provided, or as the $content
if a string is givenLaraFlash::info(String $content, String $title | Array $options)
- two params given the first is assumed to be the content (must be string) and the second will either be treated as a title or an options array depending on type given.LaraFlash::info(String $content, String $title, Array $options)
- with three params given it is assumed that you are providing the content, the title, and then an options array in that order.
To keep it simple we want to be able to add a method that enables a user to easily set the notification type with a method and the content.
Something like this:
LaraFlash::info($content)
LaraFlash::danger($content)
LaraFlash::warning($content)
LaraFlash::success($content)