Skip to content

Commit 42df41a

Browse files
author
Admin
committed
Add Request::getFiltered update README.md
1 parent 03310c6 commit 42df41a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,25 @@ for example for lumen:
278278
```
279279

280280
OBS
281+
281282
Set `$returnNullOnInvalidColumnAttributeAccess = false;` in model if you want exception instead of null on accessing invalid model attributes (It also needs error_reporting = E_ALL in php ini file).
283+
282284
Set LIVE_MODE=false in your .env file for non prod environments.
283285

286+
Use Request::getFiltered macro to sanitize data retrieved from request
287+
```php
288+
(string)\request('signature', '');
289+
```
290+
The above will throw Array to string conversion error for query: _?signature[]=_
291+
The proper way of handling it before:
292+
```php
293+
(string)\filter_var(\request('signature', ''), \FILTER_DEFAULT);
294+
```
295+
The new way of handling it:
296+
```php
297+
(string)\request()->getFiltered('signature', '');
298+
```
299+
284300
See also [Laravel crud wizard demo](https://github.com/macropay-solutions/laravel-crud-wizard-demo)
285301

286302
### III. Crud routes

0 commit comments

Comments
 (0)