You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/access-handler.md
+27-14Lines changed: 27 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,17 @@ Just pass one of the following options as a field attribute or menu item value:
18
18
19
19
*WARNING*: note this package will only prevents the elements from appearing in the front end, you still need to protect the backend access using middleware, etc.
You can pass an array of items (maybe an error list):
73
85
74
-
`{!! Alert::danger('Please fix these errors')->items($errors) !!}`
86
+
```blade
87
+
{!! Alert::danger('Please fix these errors')->items($errors) !!}
88
+
```
75
89
76
90
## Persist alert messages
77
91
78
92
Add the following middleware to the `$middleware` array in `app/Http/Kernel.php`**BEFORE** the `\App\Http\Middleware\EncryptCookies`:
79
93
80
-
```
94
+
```php
81
95
protected $middleware = [
82
96
//...
83
97
\Styde\Html\Alert\Middleware::class
@@ -95,8 +109,9 @@ If the `'translate_texts'` options is set to true in the configuration (it's tru
95
109
96
110
If you don't need to use the translator component, just set translate_texts to false in the configuration:
97
111
98
-
```
112
+
```php
99
113
//config/html.php
114
+
100
115
return [
101
116
//...
102
117
'translate_texts' => false
@@ -108,8 +123,12 @@ return [
108
123
109
124
By default, the alert messages will be rendered with the default template, located in themes/[theme]/alert, for example, for the Bootstrap theme that would be:
0 commit comments