quintenmbusiness / laravelwired
Model-driven Livewire forms and tables
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/quintenmbusiness/laravelwired
Requires
- php: ^8.2
- laravel/framework: ^11.0 || ^12.0
- livewire/livewire: ^4.0
This package is auto-updated.
Last update: 2026-01-19 00:01:27 UTC
README
LaravelWired is a small opinionated helper package that wires Eloquent models, Livewire components, and routes together with almost zero boilerplate.
It provides:
- Base Livewire components for model-driven forms and tables
- Traits you add to your Eloquent models
- Route macros that automatically register CRUD-style routes
- A predictable convention-over-configuration flow
This package is designed to be used inside an application, not necessarily as a standalone Composer-distributed package.
At this moment the package is still under development and it is not recommended to use in a production app at this time.
Installation
Since this is local to your app, register the service provider manually if needed:
use quintenmbusiness\LaravelWired\LaravelWiredServiceProvider; return [ LaravelWiredServiceProvider::class, ];
Optionally publish the config and views:
php artisan vendor:publish --tag=laravelwired-config php artisan vendor:publish --tag=laravelwired-views
Core Concepts
LaravelWired revolves around models declaring which Livewire components belong to them, and routes being generated from the model itself.
There are two main features:
- Model Forms
- Model Tables
Each is enabled by a trait on the model and a single route call.
Model Forms
1. Add the trait to your model
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use quintenmbusiness\LaravelWired\Models\HasModelForm; class Category extends Model { use HasModelForm; protected $fillable = [ 'name', 'slug', ]; }
2. Create the Livewire form component
<?php namespace App\Livewire; use App\Models\Category; use quintenmbusiness\LaravelWired\Livewire\ModelForm; class CategoryForm extends ModelForm { public function getRoutePrefix(): string { return 'categories'; } public function getModelClass(): string { return Category::class; } public function rules(): array { return [ 'form.name' => ['required', 'string', 'max:255'], 'form.slug' => ['required', 'string', 'max:255'], ]; } }
3. Define the routes
use App\Models\Category; use Illuminate\Support\Facades\Route; Route::modelForm(Category::class);
4. Routes that get registered
This single call generates:
| Method | URI | Name |
|---|---|---|
| GET | /categories/create | categories.create |
| GET | /categories/{id} | categories.show |
| GET | /categories/{id}/edit | categories.edit |
All routes:
- Are behind the
authmiddleware - Resolve to the Livewire component defined by the model
- Automatically receive an
actionparameter (create,show,edit)
Model Tables
1. Add the trait to your model
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use quintenmbusiness\LaravelWired\Models\HasModelTable; class Product extends Model { use HasModelTable; protected $fillable = [ 'name', 'price', ]; }
2. Create the Livewire table component
<?php namespace App\Livewire; use App\Models\Product; use quintenmbusiness\LaravelWired\Livewire\ModelTable; class ProductTable extends ModelTable { public function getModelClass(): string { return Product::class; } }
3. Define the routes
use App\Models\Product; use Illuminate\Support\Facades\Route; Route::modelTable(Product::class);
4. Routes that get registered
| Method | URI | Name |
|---|---|---|
| GET | /products | products.index |
This route renders the Livewire table component declared by the model.
Using Multiple Models
You can freely mix forms and tables:
use App\Models\Product; use App\Models\Category; use Illuminate\Support\Facades\Route; Route::modelForm(Product::class); Route::modelForm(Category::class); Route::modelTable(Product::class); Route::modelTable(Category::class);
No duplication, no manual route definitions.
What the Traits Do
HasModelForm
Requires the model to define (or inherit defaults for):
formComponent()formRoutePrefix()
These are used internally by the route macro.
HasModelTable
Requires the model to define (or inherit defaults for):
tableComponent()tableRoutePrefix()
Why This Exists
LaravelWired exists to:
- Remove repetitive CRUD route definitions
- Make Livewire components model-centric
- Keep routing expressive and minimal
- Allow large apps to scale CRUD behavior consistently
Philosophy
- Models declare behavior
- Routes stay thin
- Livewire handles UI logic
- Convention beats configuration
License
MIT