File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,16 @@ trait CmsUserTrait
2020 use HasRoles;
2121 use Notifiable;
2222
23+ public static function bootCmsUserTrait ()
24+ {
25+ static ::creating (function (self $ model ) {
26+ // Fill "preferred_language" if empty
27+ if (blank ($ model ->preferred_language )) {
28+ $ model ->preferred_language = config ('app.locale ' ) ?? app ()->getLocale ();
29+ }
30+ });
31+ }
32+
2333 public function canAccessPanel (Panel $ panel ): bool
2434 {
2535 return true ;
@@ -272,16 +282,4 @@ public function isLocked(): Attribute
272282 );
273283 }
274284 // endregion Attributes
275-
276- public static function boot ()
277- {
278- parent ::boot ();
279-
280- static ::creating (function (self $ model ) {
281- // Fill "preferred_language" if empty
282- if (blank ($ model ->preferred_language )) {
283- $ model ->preferred_language = config ('app.locale ' ) ?? app ()->getLocale ();
284- }
285- });
286- }
287285}
You can’t perform that action at this time.
0 commit comments