aldytoi / laravel-toi
Laravel 12 starter kit with authentication, admin dashboard, Tailwind CSS, and Lucide Icons.
Requires
- php: ^8.2
- illuminate/console: ^12.0
- illuminate/support: ^12.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
README
A Laravel 12 starter kit with authentication, admin dashboard, Tailwind CSS, and Lucide Icons.
Package: aldytoi/laravel-toi
Requirements
- PHP >= 8.2
- Laravel 12.x
- Composer 2.x
Installation
1. Create a new Laravel project
composer create-project laravel/laravel:^12.0 my-app
cd my-app
2. Require the package
composer require aldytoi/laravel-toi
3. Run the installer
php artisan toi:install
The installer will:
- Verify Laravel 12 compatibility
- Install configuration
- Install User model
- Install User migration
- Install authentication controllers
- Install routes
- Install Blade layouts and views
- Install admin dashboard
- Install Tailwind CSS and Vite resources
4. Run migrations
php artisan migrate
5. Install and build frontend assets
npm install npm run build
Authentication
Laravel Toi provides session-based authentication out of the box.
Routes
| Method | URI | Description |
|---|---|---|
| GET | /login | Login page |
| POST | /login | Login action |
| GET | /register | Registration page |
| POST | /register | Register action |
| POST | /logout | Logout action |
| GET | /admin | Admin dashboard |
Features
- User registration with validation
- Login with email and password
- Remember me functionality
- Session regeneration on login
- CSRF protection
- Password hashing (via model cast)
- Protected admin dashboard
Tailwind CSS
Laravel Toi uses Tailwind CSS for all default UI. The package installs Tailwind configuration appropriate for Laravel 12.
npm install npm run dev # Development server npm run build # Production build
Lucide Icons
All default UI uses Lucide Icons rendered as inline SVGs.
Usage in Blade
@lucide('mail') @lucide('lock') @lucide('eye')
Available Icons
The package includes the following Lucide icons:
mail,lock,eye,eye-off,log-inuser,user-plus,user-check,user-circlelayout-dashboard,users,settingslog-out,search,bell,menuchevron-down,check-circle
Admin Dashboard
The admin dashboard is accessible at /admin and requires authentication.
Features:
- Responsive sidebar navigation
- Mobile-friendly drawer menu
- Top navigation with search and notifications
- User profile menu
- Statistics cards (mock data)
- Recent activity section
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=toi-config
Available options in config/toi.php:
| Option | Description | Default |
|---|---|---|
name |
Application name | Laravel |
logo |
Logo URL for authentication views | null |
dashboard_uri |
URI for the admin dashboard | admin |
user_model |
User model class | App\Models\User |
Customization
Views
All views are standard Blade templates using Tailwind CSS. You can customize them by editing the files in resources/views/.
Published views:
resources/views/layouts/app.blade.php- Main layoutresources/views/layouts/auth.blade.php- Auth layoutresources/views/auth/login.blade.php- Login pageresources/views/auth/register.blade.php- Register pageresources/views/dashboard/index.blade.php- Dashboard
Models
The User model at app/Models/User.php follows Laravel conventions and can be extended as needed.
Controllers
Authentication controllers are in app/Http/Controllers/Auth/:
LoginController.phpRegisterController.phpLogoutController.php
Testing
php artisan test
Or with Pest:
vendor/bin/pest
Troubleshooting
"Laravel Toi requires Laravel 12"
Ensure you are running Laravel 12 or higher. Check with:
php artisan --version
Files already exist
The installer skips existing files by default. Use --force to overwrite:
php artisan toi:install --force
Migration not found
Run migrations manually:
php artisan migrate
Assets not compiling
Ensure Node.js and npm are installed, then:
npm install npm run build
Development
Local development
git clone https://github.com/aldytoi/laravel-toi.git
cd laravel-toi
composer install
Running tests
vendor/bin/phpunit
License
MIT License. See LICENSE for details.