zepfietje/laravel-route

This package is abandoned and no longer maintained. No replacement package was suggested.

Custom Laravel Route class which adds some convenient behavior.

2.1.0 2020-11-30 12:54 UTC

This package is auto-updated.

Last update: 2022-05-29 01:42:00 UTC


README

Packagist Version Packagist Downloads Starware

Laravel Route

This package extends the default Laravel Route class and adds some convenient behavior.

Installation

  1. Install this package.
    $ composer require zepfietje/laravel-route
  2. 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;

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. ⭐