11# Laravel support for tempest/view
22
3+ <p align =" center " >
4+ <a href =" https://tempestphp.com " >
5+ <img src=".github/tempest-logo.svg" width="100" />
6+ </a >
7+ </p >
8+
9+ <h1 align =" center " >Tempest</h1 >
10+ <div align =" center " >
11+ Bringing <a href =" https://tempestphp.com/view " >tempest/view</a > to Laravel.
12+ <br />
13+ Read the <a href =" https://tempestphp.com/docs " >documentation</a > to get started.
14+ </div >
15+
16+ <br />
17+ <br />
18+
319## Installation
420
521You can install the package via composer:
@@ -8,62 +24,35 @@ You can install the package via composer:
824composer require tempest/view-for-laravel
925```
1026
11- You can publish and run the migrations with:
12-
13- ``` bash
14- php artisan vendor:publish --tag=" view-for-laravel-migrations"
15- php artisan migrate
16- ```
17-
18- You can publish the config file with:
19-
20- ``` bash
21- php artisan vendor:publish --tag=" view-for-laravel-config"
22- ```
23-
24- This is the contents of the published config file:
25-
26- ``` php
27- return [
28- ];
29- ```
30-
31- Optionally, you can publish the views using
32-
33- ``` bash
34- php artisan vendor:publish --tag=" view-for-laravel-views"
35- ```
36-
3727## Usage
3828
29+ From any controller, simply return an instance of ` \Tempest\ViewForLaravel\TempestView ` :
30+
3931``` php
40- $viewForLaravel = new Tempest\ViewForLaravel();
41- echo $viewForLaravel->echoPhrase('Hello, Tempest!');
32+ final readonly class HomeController
33+ {
34+ public function __invoke()
35+ {
36+ return new TempestView(__DIR__ . '/Views/home.view.php');
37+ }
38+ }
4239```
4340
44- ## Testing
45-
46- ``` bash
47- composer test
41+ ``` html
42+ <!-- home.view.php -->
43+ <x-layout >
44+ <h1 >Hello Laravel</h1 >
45+ </x-layout >
46+
47+ <!-- x-layout.view.php -->
48+ <x-component name =" x-layout" >
49+ <html lang =" en" >
50+ <head >
51+ <title >Tempest View</title >
52+ </head >
53+ <body >
54+ <x-slot />
55+ </body >
56+ </html >
57+ </x-component >
4858```
49-
50- ## Changelog
51-
52- Please see [ CHANGELOG] ( CHANGELOG.md ) for more information on what has changed recently.
53-
54- ## Contributing
55-
56- Please see [ CONTRIBUTING] ( CONTRIBUTING.md ) for details.
57-
58- ## Security Vulnerabilities
59-
60- Please review [ our security policy] ( ../../security/policy ) on how to report security vulnerabilities.
61-
62- ## Credits
63-
64- - [ Brent Roose] ( https://github.com/tempest )
65- - [ All Contributors] ( ../../contributors )
66-
67- ## License
68-
69- The MIT License (MIT). Please see [ License File] ( LICENSE.md ) for more information.
0 commit comments