redbastie/livewire-auto-route

Automatic routes for your Livewire components.

1.0.1 2021-01-18 12:33 UTC

This package is auto-updated.

Last update: 2024-10-29 06:18:50 UTC


README

This package is no longer maintained. Please consider my latest package here: https://github.com/redbastie/tailwire

Livewire Auto Route

Automatic routes for your Livewire components.

Installation

Install via composer:

composer require redbastie/livewire-auto-route

Usage

Specify public $route* properties in your full page Livewire component:

class Vehicle extends Component
{
    public $routeUri = '/vehicle/{name}';
    public $routeDomain = null;
    public $routeMiddleware = ['guest'];
    public $routeName = 'vehicle';
    public $routeWhere = ['name' => '[A-Za-z]+'];

    public function render()
    {
        return view('livewire.vehicle');
    }
}

A minimum of $routeUri is required.