Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 1.11 KB

README.md

File metadata and controls

59 lines (47 loc) · 1.11 KB

Laravel support for tempest/view

Bringing tempest/view to Laravel.
Read the documentation to get started.


Installation

You can install the package via composer:

composer require tempest/view-for-laravel

Usage

From any controller, simply return an instance of \Tempest\ViewForLaravel\TempestView:

use Tempest\ViewForLaravel\GenericTempestView;

final readonly class HomeController
{
    public function __invoke()
    {
        return new GenericTempestView(__DIR__ . '/Views/home.view.php');
    }
}
<!-- home.view.php -->
<x-layout>
    <h1>Hello Laravel</h1>
</x-layout>

<!-- x-layout.view.php -->
<x-component name="x-layout">
    <html lang="en">
    <head>
        <title>Tempest View</title>
    </head>
    <body>
        <x-slot />
    </body>
    </html>
</x-component>