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.

Maintainers

Package info

github.com/ilhamsyabani/laravel-volt-starter

Language:Blade

pkg:composer/ilhamsyabani/laravel-volt-starter

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-06-14 07:45 UTC

This package is auto-updated.

Last update: 2026-06-14 08:04:59 UTC


README

Latest Version on Packagist Total Downloads License

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 ๐Ÿ‡ฎ๐Ÿ‡ฉ