Skip to content

Commit 541a8a7

Browse files
zeezo887ifox
authored andcommitted
fallback to empty string when no traits are selected
1 parent 6d622a2 commit 541a8a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Commands/ModuleMake.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ private function addCapsuleToConfigFile(string $name): void
388388
'list' => [
389389
...
390390
[
391-
391+
392392
'name' => '$name',
393393
'enabled' => true,
394394
],
@@ -420,7 +420,7 @@ private function addEntryToNavigationFile(string $key, array $value): void
420420
public function boot()
421421
{
422422
...
423-
423+
424424
TwillNavigation::addLink(
425425
NavigationLink::make()->forModule('$key')
426426
);
@@ -434,7 +434,7 @@ public function boot()
434434
public function boot()
435435
{
436436
...
437-
437+
438438
TwillNavigation::addLink(
439439
NavigationLink::make()->forSingleton('$key')
440440
);
@@ -666,7 +666,7 @@ private function createModels($modelName = 'Item', $activeTraits = [])
666666
'{{baseModel}}',
667667
], [
668668
$modelName,
669-
$activeModelTraits->whenNotEmpty(fn ($t) => 'use ' . $t->join(', ') . ';'),
669+
$activeModelTraits->whenNotEmpty(fn ($t) => 'use ' . $t->join(', ') . ';', fn () => ''),
670670
$activeModelTraitsImports->join("\n"),
671671
$activeModelImplements,
672672
$this->namespace('models', 'Models'),

0 commit comments

Comments
 (0)