1 | <?php |
||
2 | /** |
||
3 | * Created on 22/03/18 by enea dhack. |
||
4 | */ |
||
5 | |||
6 | namespace Enea\Authorization\Observers; |
||
7 | |||
8 | use Enea\Authorization\Support\Determiner; |
||
9 | use Illuminate\Database\Eloquent\Model; |
||
10 | use Illuminate\Support\Str; |
||
11 | |||
12 | class GrantableObserver |
||
13 | { |
||
14 | 70 | public function saving(Model $model): void |
|
15 | { |
||
16 | 70 | if (Determiner::transformSecretNameToKebabCase()) { |
|
17 | 68 | $name = $model->getAttribute('display_name'); |
|
18 | 68 | $model->setAttribute('secret_name', Str::kebab($name)); |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
19 | } |
||
20 | 70 | } |
|
21 | } |
||
22 |