laravel-route maintained by zepfietje
Laravel Route
This package extends the default Laravel Route class and adds some convenient behavior.
Installation
- Install this package.
$ composer require zepfietje/laravel-route - Import the
Routeclass of this package in your routes file instead of the default one.- use Illuminate\Support\Facades\Route; + use ZepFietje\Route\Route;
Usage
view()
All bound parameters are automatically passed to the view.
To make this work with route model binding, be sure to register an explicit binding.
Before:
Route::get('users/{user}', function (User $user) {
return view('users.show', ['user' => $user]);
});
After:
Route::view('users/{user}', 'users.show');
Starware
Laravel Route is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐