Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 890cf1a

Browse files
Fixes code example for bag filtering.
1 parent c7b2159 commit 890cf1a

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -427,22 +427,7 @@ Laraconfig uses one single bag called `default`. If you have declared in the man
427427
428428
```php
429429
// app/Models/User.php
430-
431-
/**
432-
* Returns the bags this model uses for settings.
433-
*
434-
* @return array|string
435-
*/
436-
public function getSettingsBags(): array|string
437-
{
438-
$bags = ['notifications'];
439-
440-
if ($this->is_premium) {
441-
$bags[] = 'theme';
442-
}
443-
444-
return $bags;
445-
}
430+
i
446431
```
447432
448433
The above will apply a filter to the query when retrieving settings from the database. This makes easy to swap bags when a user has a different role or property, or programmatically.

0 commit comments

Comments
 (0)