File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 321
321
322
322
'lower_table_name_first ' => false ,
323
323
324
+ /*
325
+ |--------------------------------------------------------------------------
326
+ | Model Names
327
+ |--------------------------------------------------------------------------
328
+ |
329
+ | By default the generator will create models with names that match your tables.
330
+ | However, if you wish to manually override the naming, you can specify a mapping
331
+ | here between table and model names.
332
+ |
333
+ | Example:
334
+ | A table called 'billing_invoices' will generate a model called `BillingInvoice`,
335
+ | but you'd prefer it to generate a model called 'Invoice'. Therefore, you'd add
336
+ | the following array key and value:
337
+ | 'billing_invoices' => 'Invoice',
338
+ */
339
+
340
+ 'model_names ' => [
341
+
342
+ ],
343
+
324
344
/*
325
345
|--------------------------------------------------------------------------
326
346
| Relation Name Strategy
Original file line number Diff line number Diff line change @@ -521,6 +521,13 @@ public function getQualifiedUserClassName()
521
521
*/
522
522
public function getClassName ()
523
523
{
524
+ // Model names can be manually overridden by users in the config file.
525
+ // If a config entry exists for this table, use that name, rather than generating one.
526
+ $ overriddenName = $ this ->config ('model_names. ' . $ this ->getTable ());
527
+ if ($ overriddenName ) {
528
+ return $ overriddenName ;
529
+ }
530
+
524
531
if ($ this ->shouldLowerCaseTableName ()) {
525
532
return Str::studly (Str::lower ($ this ->getRecordName ()));
526
533
}
You can’t perform that action at this time.
0 commit comments