@@ -49,29 +49,43 @@ public function store()
4949}
5050```
5151
52- You may also define following flash messages:
53-
54- | method | description |
55- | -------------------------------------------| -------------------------------------------------------------------------------|
56- | ` flash('your-message', 'primary') ` | Set the flash type to "primary". |
57- | ` flash('your-message', 'secondary') ` | Set the flash type to "secondary". |
58- | ` flash('your-message', 'success') ` | Set the flash type to "success". |
59- | ` flash('your-message', 'warning') ` | Set the flash type to "warning". |
60- | ` flash('your-message', 'danger') ` | Set the flash type to "error". |
61- | ` flash('your-message', 'error') ` | Set the flash type to "error" (alias to "danger") without a close button. |
62- | ` flash('your-message', 'error', true) ` | Set the flash type to "error" with a close button to the flash message. |
63- | ` flash('your-message', 'light') ` | Set the flash type to "light". |
64-
65- You may also use facade directly:
52+ The general way to define a flash message is a following:
53+ ``` php
54+ flash()->danger('The error message')->important();
55+ flash()->info('The info message');
56+ ```
57+
58+ But you may use a shorter syntax:
59+ ``` php
60+ flash('The error message', true);
61+ flash('The info message');
62+ ```
63+
64+ You may also define the following flash messages:
65+
66+ | method | description |
67+ | -------------------------------------------| ---------------------------------------------------------------------------|
68+ | ` flash('your-message', 'primary') ` | Set the flash type to "primary". |
69+ | ` flash('your-message', 'secondary') ` | Set the flash type to "secondary". |
70+ | ` flash('your-message', 'success') ` | Set the flash type to "success". |
71+ | ` flash('your-message', 'warning') ` | Set the flash type to "warning". |
72+ | ` flash('your-message', 'info') ` | Set the flash type to "info". |
73+ | ` flash('your-message', 'danger') ` | Set the flash type to "error". |
74+ | ` flash('your-message', 'error') ` | Set the flash type to "error" (alias to "danger") w/o a close button. |
75+ | ` flash('your-message', 'error', true) ` | Set the flash type to "error" with a close button to the message. |
76+ | ` flash('your-message', 'light') ` | Set the flash type to "light". |
77+ | ` flash('your-message', 'dark') ` | Set the flash type to "dark". |
78+
79+ You may also define messages, by using Flash facade:
6680``` php
6781use Apphp\Flash\Flash;
6882```
6983
70- | method | description |
71- | -------------------------------------------| ------------------------------------------------------------------------------- |
72- | ` Flash::success('your-message') ` | Set the success flash message. |
73- | ` Flash::error('your-message') ` | Set the flash type to "error" without a close button to the flash message. |
74- | ` Flash::error('your-message', true) ` | Set the flash type to "error" with a close button to the flash message. |
84+ | method | description |
85+ | -------------------------------------------| ----------------------------------------------------------------------------|
86+ | ` Flash::success('your-message') ` | Set the success flash message. |
87+ | ` Flash::error('your-message') ` | Set the flash type to "error" w/o a close button to the message. |
88+ | ` Flash::error('your-message', true) ` | Set the flash type to "error" with a close button to the message. |
7589etc.
7690
7791
@@ -158,7 +172,7 @@ div.alert:not(.alert-important) {
158172```
159173
160174
161- ## Customization
175+ ## Customize Views
162176
163177To change HTML template of the message or use your own, publish view file and customize it according to suit your needs.
164178``` php
0 commit comments