Skip to content

Commit a708a8a

Browse files
Refactor: Enhance Livewire stub to include layout, title and description parameters
1 parent 0d3a936 commit a708a8a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Commands/stubs/livewire.stub

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class [class] extends Component
88
{
99
public function render()
1010
{
11-
return view('[view]');
11+
return view('[view]')->layout('[layout]', [
12+
'title' => '',
13+
'description' => '',
14+
]);
1215
}
1316
}

src/Traits/LivewireComponentParser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ protected function getClassContents()
136136
'/\[namespace\]/',
137137
'/\[class\]/',
138138
'/\[view\]/',
139+
'/\[layout\]/',
139140
],
140141
[
141142
$this->getClassNamespace(),
142143
$this->getClassName(),
143144
$this->getViewName(),
145+
config('livewire.layout', 'components.layouts.app'),
144146
],
145147
$template,
146148
);

0 commit comments

Comments
 (0)