Adding app/View/Components/Layout.php
This commit is contained in:
parent
0f5779b1e6
commit
1f7b1d80ab
1 changed files with 28 additions and 0 deletions
28
app/View/Components/Layout.php
Normal file
28
app/View/Components/Layout.php
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
class Layout extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Layout name
|
||||||
|
*/
|
||||||
|
public string $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(string $name = 'app')
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view("layouts.{$this->name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in a new issue