wuwx / laravel-plus-view
v9.0.0
2024-05-29 00:36 UTC
Requires
- php: ^7.3|^8.0
- illuminate/support: ^5.6|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^3.6|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0
- phpunit/phpunit: ^7.0|^8.0|^9.0|^10.0|^11.0
README
Installation
Quick
To install through composer, simply run the following command:
composer require wuwx/laravel-plus-view
Add Service Provider
Next add the following service provider in config/app.php
.
'providers' => [ Wuwx\LaravelPlusView\LaravelPlusViewServiceProvider::class, ],
Add Blade Template
index.html.blade.php
<h1>{{ $dataTypeContent->title }}</h1>
index.json.blade.php
{!! json_encode($dataTypeContent) !!}
Test
curl http://localhost:8000/users curl http://localhost:8000/users?_format=json curl http://localhost:8000/users -H "Accept: application/json"