This package extends the default Laravel Route
class and adds some convenient behavior.
- Install this package.
$ composer require zepfietje/laravel-route
- Import the
Route
class of this package in your routes file instead of the default one.- use Illuminate\Support\Facades\Route; + use ZepFietje\Route\Route;
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');
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. ⭐