Laravel Livewire full page component routing.

Overview

Laravel Livewire Routes

Laravel Livewire full page component routing. This package allows you to specify routes directly inside your full page Livewire components via a route method. The route method uses the Laravel Route facade, giving you complete control.

Documentation

Installation

Require the package via composer:

composer require bastinald/laravel-livewire-routes

Usage

Declare a route method in your Livewire components:

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

class Login extends Component
{
    public function route()
    {
        return Route::get('/login', static::class)
            ->name('login')
            ->middleware('guest');
    }
    
    public function render()
    {
        return view('livewire.auth.login');
    }
}

Passing route parameters to the component mount method:

use App\Models\User;
use Illuminate\Support\Facades\Route;
use Livewire\Component;

class Update extends Component
{
    public $user;

    public function route()
    {
        return Route::get('/users/update/{user}', static::class)
            ->name('users.update')
            ->middleware('auth');
    }
    
    public function mount(User $user)
    {
        $this->user = $user;
    }
    
    public function render()
    {
        return view('livewire.users.update');
    }
}
You might also like...
Livewire component for dependant and/or searchable select inputs
Livewire component for dependant and/or searchable select inputs

Livewire Select Livewire component for dependant and/or searchable select inputs Preview Installation You can install the package via composer: compos

Render a Livewire component on a specific target in the DOM.

Livewire Portals Render a Livewire component on a specific target in the DOM. Install THIS PACKAGE IS STILL IN DEVELOPMENT, TO USE, PLEASE ADD THE FOL

This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

A TALL (Tailwind CSS, Alpine.js, Laravel and Livewire) Preset for Laravel
A TALL (Tailwind CSS, Alpine.js, Laravel and Livewire) Preset for Laravel

Laravel TALL Preset A front-end preset for Laravel to scaffold an application using the TALL stack, jumpstarting your application's development. If yo

Laravel breeze is a PHP Laravel library that provides Authentication features such as Login page , Register, Reset Password and creating all Sessions Required.

About Laravel breeze To give you a head start building your new Laravel application, we are happy to offer authentication and application starter kits

Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

Laravel messenger. A full messenger suite for your new / existing laravel app
Laravel messenger. A full messenger suite for your new / existing laravel app

Laravel messenger. A full messenger suite for your new / existing laravel app! Private and group threads between multiple models, with real-time messaging, reactions, attachments, calling, chat bots, and more!

Laravel Livewire Excel Upload with Progressbar

Laravel Livewire Excel Upload with Progressbar This is sample project, that explains how to import Excel files with progress bar Steps to run project

 Belich Tables: a datatable package for Laravel Livewire
Belich Tables: a datatable package for Laravel Livewire

Belich Tables is a Laravel package base on Livewire and AlpineJS that allows you to create scaffold datatables with search, column sort, filters, pagination, etc...

Comments
  • how to include?

    how to include?

    Should this be automagically registered as a service provider in laravel 8 and using composer to install the package? Right now when I simply install it and try to use it within a livewire component, I am getting an exception that the Route class is not found. Sorry, I know I am missing something basic.

    opened by MACscr 2
  • Issue with route and directory separator

    Issue with route and directory separator

    Hello,

    First thanks for all the work you are doing here. I tried to play a little bit with your ui repository, and it worked well. After I had discovered that the project have been archived, I tried to update my local work ... and I got an an error with the route bundle.

    Linked to your fix 41ce8663d15103df31bc10807a1f5b4a10cac379

    Indeed, you are playing with paths & realpath function, and then this is sensible about windows/linux directory separators. Going back to the DIRECTORY_SEPARATOR fix the issue.

            $component = $namespace . str_replace(
                    ['/', '.php'],
                    ['\\', ''],
                    Str::after($component->getRealPath(), realpath(app_path()) . DIRECTORY_SEPARATOR)
                );
    

    Issue: Install fresh laravel, and install bastinald/laravel-livewire-ui. No route found (no Welcome, nor Home) System: Windows & XAMPP

    Fix: Use DIRECTORY_SEPARATOR (rollback).

    opened by Thiktak 1
  • Package has moved

    Package has moved

    I am the creator of this package

    Package has been moved here: https://github.com/legodion/convoy

    It has been updated for Laravel 9 etc, and that repo will be actively maintained going forward.

    opened by legodion 0
  • Possible to use with vanilla components?

    Possible to use with vanilla components?

    Is it possible to use this with vanilla components? Trying to reduce the number of livewire components when livewire isnt needed in order to reduce the number of nested livewire component issues that I have to overcome. I do though love being able to do my routes right in the component.

    opened by MACscr 1
Owner
null
Laravel Livewire form component with declarative Bootstrap 5 fields and buttons.

Laravel Livewire Forms Laravel Livewire form component with declarative Bootstrap 5 fields and buttons. Requirements Bootstrap 5 Installation composer

null 49 Oct 29, 2022
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Livewire UI 792 Jan 3, 2023
A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards.

TALL multiselect cards A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards. Table of content

Frederic Habich 19 Dec 14, 2022
Laravel Livewire component to show Events in a good looking monthly calendar

Livewire Calendar This package allows you to build a Livewire monthly calendar grid to show events for each day. Events can be loaded from within the

Andrés Santibáñez 680 Jan 4, 2023
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Wire Elements 790 Dec 27, 2022
A dynamic table component for Laravel Livewire - For Slack access, visit:

A dynamic Laravel Livewire component for data tables. Bootstrap 4 Demo | Bootstrap 5 Demo | Tailwind Demo | Demo Repository Installation You can insta

Anthony Rappa 1.3k Jan 1, 2023
A dynamic Laravel Livewire component for multi steps form

Livewire component that provides you with a wizard that supports multiple steps form while maintaining state.

Vildan Bina 233 Jan 4, 2023
An advanced datatable component for Laravel Livewire.

Livewire Smart Table An advanced, dynamic datatable component with pagination, sorting, and searching including json data. Installation You can instal

Turan Karatuğ 87 Oct 13, 2022
Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

About LivewireUI Modal LivewireUI Modal is a Livewire component that provides you with a modal that supports multiple child modals while maintaining s

Livewire UI 806 Jan 6, 2023
Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

About Wire Elements Modal Wire Elements Modal is a Livewire component that provides you with a modal that supports multiple child modals while maintai

Wire Elements 806 Jan 6, 2023