ilhamsyabani / laravel-volt-starter
A modern Laravel starter kit using Livewire Volt, Laravel Folio, and Tailwind CSS โ 27+ UI components, theming system, CRUD generators, and preset templates.
Package info
github.com/ilhamsyabani/laravel-volt-starter
Language:Blade
pkg:composer/ilhamsyabani/laravel-volt-starter
Requires
- php: ^8.2
- blade-ui-kit/blade-icons: ^1.6
- illuminate/contracts: ^11.0|^12.0
- laravel/folio: ^1.0
- livewire/livewire: ^3.0
- livewire/volt: ^1.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
A modern, opinionated Laravel starter kit using Livewire Volt, Laravel Folio, and Tailwind CSS. Stop repeating yourself โ get a production-ready structure in minutes.
โจ What's Included
| Feature | Detail |
|---|---|
| ๐งฉ Livewire Volt | Single-file reactive components |
| ๐ Laravel Folio | File-based page routing |
| ๐จ 24+ UI Components | Button, Input, Textarea, Select, Checkbox, Radio, Toggle, Badge, Card, Alert, Toast, Spinner, Modal, Tabs, Table, Pagination, Breadcrumb, Avatar, Dropdown, Empty State, Skeleton, Tooltip โ 100% MIT |
| ๐ Theme System | CSS-variable based โ switch entire color scheme with one class (theme-rose, theme-emerald, theme-amber, theme-sky) |
| ๐ Auth scaffolding | Login, register with Volt components |
| ๐ฅ Role system | superadmin, admin, user out of the box |
| ๐ Dark mode | Full dark mode with persisted preference |
| ๐ Toast notifications | Global notify system, stackable |
| ๐ฑ Responsive sidebar | Mobile-ready navigation with Alpine.js |
| ๐ ๏ธ CRUD generator | volt-starter:crud Post --fields=title:string,body:text |
| ๐ Page generator | volt-starter:page users/index --auth |
| ๐ผ๏ธ Component Showcase | Built-in /showcase page to preview & test themes |
๐จ Theming
All components use CSS variables defined in resources/css/volt-starter.css. Switch the entire color scheme by adding a class to <html>:
<html class="theme-rose"> <!-- or theme-emerald, theme-amber, theme-sky -->
Or define your own theme:
.theme-custom { --vs-primary-500: 168 85 247; /* your RGB values */ --vs-primary-600: 147 51 234; --vs-primary-700: 126 34 206; /* ... */ }
No paid component library required โ everything is plain Tailwind + Blade.
๐ Installation
composer require ilhamsyabani/laravel-volt-starter
Then run the install command:
# Basic install (layouts + dashboard) php artisan volt-starter:install # With authentication scaffolding php artisan volt-starter:install --auth # With auth + role system php artisan volt-starter:install --auth --roles # Install everything php artisan volt-starter:install --full
โ๏ธ Requirements
- PHP ^8.2
- Laravel ^11.0 or ^12.0
- Livewire Volt ^1.0
- Laravel Folio ^1.0
- Tailwind CSS (via Vite) โ already in fresh Laravel installs
๐ ๏ธ Generator Commands
Generate a Volt + Folio page
# Creates resources/views/pages/products/index.blade.php php artisan volt-starter:page products/index --auth # Admin-only page php artisan volt-starter:page admin/dashboard --admin # Superadmin-only page php artisan volt-starter:page admin/users --superadmin # Bare minimum (no boilerplate) php artisan volt-starter:page reports/monthly --bare
Generate full CRUD pages
# Basic CRUD for a Post model php artisan volt-starter:crud Post # With specific fields php artisan volt-starter:crud Product --fields=title:string,description:text,price:integer,status:select:pending|active # With migration php artisan volt-starter:crud Post --fields=title:string,body:text --with-migration
This generates:
resources/views/pages/
โโโ posts/
โโโ index.blade.php โ GET /posts
โโโ create.blade.php โ GET /posts/create
โโโ [post]/
โโโ edit.blade.php โ GET /posts/{post}/edit
โโโ show.blade.php โ GET /posts/{post}
๐ Published File Structure
After running volt-starter:install --full:
resources/
โโโ css/
โ โโโ volt-starter.css # Theme CSS variables
โโโ views/
โ โโโ components/
โ โ โโโ layouts/
โ โ โ โโโ app.blade.php # Main layout wrapper
โ โ โ โโโ app/
โ โ โ โโโ sidebar.blade.php
โ โ โโโ ui/ # 24+ UI components
โ โ โโโ button.blade.php
โ โ โโโ input.blade.php
โ โ โโโ card.blade.php
โ โ โโโ table/
โ โ โ โโโ th.blade.php
โ โ โ โโโ td.blade.php
โ โ โ โโโ row.blade.php
โ โ โ โโโ empty.blade.php
โ โ โโโ ...
โ โโโ pages/
โ โโโ dashboard.blade.php
โ โโโ showcase.blade.php
โ โโโ auth/
โ โ โโโ login.blade.php
โ โ โโโ register.blade.php
โ โโโ settings/
โ โโโ profile.blade.php
routes/
โโโ folio.php # Folio route configuration
app/Http/Middleware/
โโโ EnsureUserHasRole.php
โโโ EnsureUserIsOwner.php
โโโ EnsureUserHasPermission.php
๐ Toast Notification System
Available everywhere via Livewire dispatch:
// In any Volt component $this->dispatch('notify', type: 'success', message: 'Saved!'); $this->dispatch('notify', type: 'error', message: 'Something went wrong.'); $this->dispatch('notify', type: 'warning', message: 'Please check your input.'); $this->dispatch('notify', type: 'info', message: 'Processing...');
๐ฅ Role System
When installed with --roles, a role column is added to users table:
// In any Volt component or middleware auth()->user()->role // 'superadmin' | 'admin' | 'user' // Helper trait (included) use Ilhamsyabani\VoltStarter\Traits\HasRoles; $user->isAdmin(); // true if admin or superadmin $user->isSuperAdmin(); // true if superadmin $user->isUser(); // true if user $user->hasRole('admin'); // check specific role
Middleware Usage
// In routes/folio.php or bootstrap/app.php Route::middleware(['auth', 'verified', 'role:admin'])->group(fn () => Folio::route('/admin'));
๐ Laravel Folio Integration
Folio enables file-based routing. Every file in resources/views/pages/ becomes a route automatically.
Route Patterns
| File Path | Route |
|---|---|
pages/index.blade.php |
GET / |
pages/users.blade.php |
GET /users |
pages/users/index.blade.php |
GET /users |
pages/users/create.blade.php |
GET /users/create |
pages/posts/[post]/edit.blade.php |
GET /posts/{post}/edit |
Middleware in Pages
Add middleware directly in the page file:
<?php use function Livewire\Volt\{state}; middleware(['auth', 'verified']); // Auth required middleware(['auth', 'role:admin']); // Admin only middleware(['auth', 'role:superadmin']); // Superadmin only state(['name' => '']); ?>
๐งฉ UI Components
Button
<x-ui.button variant="primary" size="md" icon="plus"> Add New </x-ui.button> <x-ui.button variant="danger" size="sm" icon="trash" loading> Delete </x-ui.button> <x-ui.button href="/dashboard" variant="ghost" iconTrailing="arrow-right"> Continue </x-ui.button>
Input
<x-ui.input wire:model="email" label="Email Address" placeholder="you@example.com" icon="envelope" required />
Card
<x-ui.card title="Statistics" subtitle="Monthly overview"> <p>Card content here</p> <x-slot:actions> <x-ui.button size="sm">View All</x-ui.button> </x-slot:actions> <x-slot:footer> Footer content </x-slot:footer> </x-ui.card>
Table
<x-ui.table> <x-slot:head> <x-ui.table.th>Name</x-ui.table.th> <x-ui.table.th>Email</x-ui.table.th> <x-ui.table.th align="right">Actions</x-ui.table.th> </x-slot:head> @forelse ($users as $user) <x-ui.table.row> <x-ui.table.td>{{ $user->name }}</x-ui.table.td> <x-ui.table.td>{{ $user->email }}</x-ui.table.td> <x-ui.table.td align="right"> <x-ui.button size="sm" variant="ghost">Edit</x-ui.button> </x-ui.table.td> </x-ui.table.row> @empty <x-ui.table.empty colspan="3"> No users found. </x-ui.table.empty> @endforelse </x-ui.table>
Modal
{{-- Trigger button --}} <x-ui.button @click="$dispatch('open-modal', { name: 'confirm-delete' })"> Delete </x-ui.button> {{-- Modal component --}} <x-ui.modal name="confirm-delete" title="Confirm Delete"> <p>Are you sure?</p> <x-slot:footer> <x-ui.button variant="secondary" @click="$dispatch('close-modal', { name: 'confirm-delete' })"> Cancel </x-ui.button> <x-ui.button variant="danger" wire:click="delete"> Delete </x-ui.button> </x-slot:footer> </x-ui.modal>
Breadcrumb
<x-ui.breadcrumb :items="[ ['label' => 'Dashboard', 'href' => '/dashboard'], ['label' => 'Posts', 'href' => '/posts'], ['label' => 'Edit'], ]" />
Alert
<x-ui.alert type="success" title="Success!" dismissible> Your changes have been saved. </x-ui.alert> <x-ui.alert type="error" title="Error"> Something went wrong. </x-ui.alert>
๐ Belajar Volt + Folio
Konsep Dasar Volt
| Fitur | Penjelasan | Contoh |
|---|---|---|
state() |
Reactive state | state(['name' => '']) |
computed() |
Computed property | computed(fn() => User::all()) |
mount() |
Initial load | mount(fn() => $this->loadData()) |
rules() |
Validation | rules(['email' => 'required|email']) |
Contoh Volt Component
<?php use App\Models\User; use function Livewire\Volt\{state, computed}; state(['search' => '']); $users = computed(function () { return User::query() ->when($this->search, fn($q) => $q->where('name', 'like', "%{$this->search}%")) ->paginate(10); }); $delete = function (User $user) { $user->delete(); $this->dispatch('notify', type: 'success', message: 'User deleted.'); }; ?> <x-layouts.app> <!-- Template here --> </x-layouts.app>
Contoh Folio Routing
// routes/folio.php use Illuminate\Support\Facades\Route; use Laravel\Folio\Facades\Folio; // Load all pages from resources/views/pages/ Folio::route('/'); // Protected routes Route::middleware(['auth', 'verified'])->group(fn () => Folio::route('/dashboard')); // Admin routes Route::middleware(['auth', 'role:admin'])->group(fn () => Folio::route('/admin'));
๐ค Contributing
Pull requests are welcome! Please read CONTRIBUTING.md first.
git clone https://github.com/ilhamsyabani/laravel-volt-starter
cd laravel-volt-starter
composer install
./vendor/bin/pest
๐ License
MIT โ see LICENSE
Built with โค๏ธ by ilhamsyabani ยท Indonesia ๐ฎ๐ฉ