5

GitHub - legodion/convoy: Declare routes inside Laravel Livewire components.

 2 years ago
source link: https://github.com/legodion/convoy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Convoy

This package allows you to declare routes inside of your full page Laravel Livewire components.

All you have to do is create a route method inside of your Livewire components which returns a Laravel Route. The package will automatically detect the route. This package also works perfectly alongside traditional Laravel route files, and even allows you to cache them.

Requirements

You must have Laravel Livewire installed before using this package.

Installation

Require this package via Composer:

composer require legodion/convoy

Usage

Declare a route method inside of your Laravel Livewire components:

namespace App\Http\Livewire\Auth;

use Illuminate\Support\Facades\Route;
use Livewire\Component;

class Login extends Component
{
    public function route()
    {
        return Route::get('/login')
            ->name('login')
            ->middleware('guest');
    }

    public function render()
    {
        return view('auth.login');
    }
}

Commands

Making Components

Create an inline Livewire component containing the route method:

php artisan convoy:component {name}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK