File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 416
416
'override_pluralize_for ' => [
417
417
418
418
],
419
+
420
+ /*
421
+ |--------------------------------------------------------------------------
422
+ | Move $hidden property to base files
423
+ |--------------------------------------------------------------------------
424
+ | When base_files is true you can set hidden_in_base_files to true
425
+ | if you want the $hidden to be generated in base files
426
+ |
427
+ */
428
+ 'hidden_in_base_files ' => false ,
429
+
419
430
/*
420
431
|--------------------------------------------------------------------------
421
432
| Move $fillable property to base files
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ protected function body(Model $model)
459
459
$ body .= $ this ->class ->field ('casts ' , $ model ->getCasts (), ['before ' => "\n" ]);
460
460
}
461
461
462
- if ($ model ->hasHidden () && $ model ->doesNotUseBaseFiles ()) {
462
+ if ($ model ->hasHidden () && ( $ model ->doesNotUseBaseFiles () || $ model -> hiddenInBaseFiles () )) {
463
463
$ body .= $ this ->class ->field ('hidden ' , $ model ->getHidden (), ['before ' => "\n" ]);
464
464
}
465
465
@@ -575,7 +575,7 @@ protected function userFileBody(Model $model)
575
575
{
576
576
$ body = '' ;
577
577
578
- if ($ model ->hasHidden ()) {
578
+ if ($ model ->hasHidden () && ! $ model -> hiddenInBaseFiles () ) {
579
579
$ body .= $ this ->class ->field ('hidden ' , $ model ->getHidden ());
580
580
}
581
581
Original file line number Diff line number Diff line change @@ -1253,6 +1253,14 @@ public function fillableInBaseFiles(): bool
1253
1253
return $ this ->config ('fillable_in_base_files ' , false );
1254
1254
}
1255
1255
1256
+ /**
1257
+ * @return bool
1258
+ */
1259
+ public function hiddenInBaseFiles (): bool
1260
+ {
1261
+ return $ this ->config ('hidden_in_base_files ' , false );
1262
+ }
1263
+
1256
1264
/**
1257
1265
* @return bool
1258
1266
*/
You can’t perform that action at this time.
0 commit comments