brayniverse / laravel-route-view-helper
This package is abandoned and no longer maintained.
No replacement package was suggested.
Syntactic sugar for those occasions when you only want to display a basic view.
v1.0.5
2017-02-28 15:40 UTC
Requires
- php: ^5.5.9 || ^7.0
- illuminate/http: 5.1.* || 5.2.* || 5.3.* || 5.4.*
- illuminate/support: 5.1.* || 5.2.* || 5.3.* || 5.4.*
Requires (Dev)
- mockery/mockery: ^0.9.5
- orchestra/testbench: ~3.0
- phpunit/phpunit: ^4.8 || ^5.0
This package is not auto-updated.
Last update: 2020-01-24 16:24:41 UTC
README
Syntactic sugar for those occasions when you only want to display a basic view.
This package adds a Route::view()
helper method so you don't have to create a closure when all you are returning is a view.
Installation
Begin by installing the package through Composer.
$ composer require brayniverse/laravel-route-view-helper
Then add the following to your providers array in config/app.php
.
Brayniverse\LaravelRouteViewHelper\ServiceProvider::class
Usage
Normally you'd have to return a view in either a controller method or callback like the following:
public function contact() { return view('contact'); } // or Route::get('/contact', function () { return view('contact'); });
Now you can do the same in one line.
Route::view('/contact', 'contact');