Laravel & TWCSS v4 & Vite v6
Laravel & TWCSS v4 guide for Trezo.
Overview
π Laravel v12 + TailwindCSS v4 + Vite v6 β Modern Full-Stack Starter
Build blazing-fast and maintainable web applications with the power of Laravel 12, the latest utility-first Tailwind CSS v4, and ultra-fast frontend tooling powered by Vite 6.
Laravel v12
Robust PHP framework with elegant syntax, powerful routing, Eloquent ORM, and modern features like lazy loading, native type declarations, and improved performance.
TailwindCSS v4
Latest utility-first CSS framework with powerful design tokens, improved dark mode, fluid typography, and better build performance β no need to write custom CSS.
Vite.js v6
Lightning-fast build tool for frontend assets, offering instant hot module replacement (HMR), ES module support, and deep integration with Laravel via Laravel Vite Plugin.
β Key Benefits:
- Modern development workflow with automatic asset refreshing
- Seamless integration between Blade templates and Tailwind utility classes
- Optimized production builds using Viteβs Rollup-based bundling
- Built-in support for Livewire, Inertia.js, and Vue/React if needed
- Developer-friendly DX with environment-based configs, aliases, and more
File Structure
trezo-laravel-twcss
βββ app
β βββ Http
β βββ Models
β βββ Providers
βββ bootstrap
βββ config
β βββ app.php
β βββ auth.php
β βββ cache.php
β βββ database.php
β βββ filesystems.php
β βββ logging.php
β βββ mail.php
β βββ queue.php
β βββ services.php
β βββ session.php
β βββ sidebar.php # Sidebar links array
βββ database
βββ node_modules
βββ public
β βββ assets # Public assets (CSS, JS, fonts, images)
β β βββ css
β β βββ fonts
β β βββ images
β βββ js
β βββ .htaccess
β βββ favicon.ico
β βββ index.php # Entry point for web requests
β βββ robots.txt
βββ resources # Blade views, app CSS/JS, language files
β βββ css
β βββ js
β βββ views
βββ routes # Route definitions for web and console
β βββ console.php
β βββ web.php
βββ storage # Logs, compiled views, file uploads
βββ tests # PHPUnit test cases
βββ vendor # Composer dependencies
βββ .editorconfig # Editor formatting rules
βββ .env # Environment configuration file
βββ .gitignore
βββ artisan # CLI entry for Laravel commands
βββ composer.json # PHP dependencies and project metadata
βββ composer.lock
βββ package.json # JS dependencies (if using Laravel Mix)
Setup Development Environment
Server Requirements
To run the Trezo Laravel project, ensure the following server requirements are met:
- PHP Version: PHP 8.0 or higher
- Node.js Version: Node.js v18.x or v20.x (LTS) or higher
- Web Server: Apache or Nginx
- Database: MySQL 5.7+ or PostgreSQL
- Composer: Latest version
- Operating System: Linux, macOS, or Windows
Required PHP Extensions
Ensure the following PHP extensions are installed and enabled:
php extensions:
BCMath
Ctype
Fileinfo
JSON
Mbstring
OpenSSL
PDO
Tokenizer
XML
Pre-requisites
Composer
Ensure that Composer is installed globally on your machine. You can install it using the following command:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
Setting Up the Project
Open the project from the ThemeForest downloaded bundle.
- And open the terminal into the bundle.
cd trezo-laravel
composer install
- Create the
.envFile:- In the root directory of your Laravel project, create a new file named
.env - You can copy the content from the .env.example file as a starting point. In most cases, you can run the following command in your terminal:
- In the root directory of your Laravel project, create a new file named
cp .env.example .env
- Generate the Application Key:
- Run the following command to generate a new application key, which is essential for encryption and session management:
php artisan key:generate
- Configure the Database in .env:
- If you are using SQLite, update the .env file to use the SQLite connection:
DB_CONNECTION=sqlite
DB_DATABASE=database/database.sqlite
- Ensure the
database.sqlitefile exists in the database directory. You can create it by running:
touch database/database.sqlite
- Run Migrations:
- After setting up the
.envfile, run the database migrations to create the necessary tables:
- After setting up the
php artisan migrate
- Clear Cache and Serve the Application:
- Run the following commands to clear any cached configuration and start the Laravel development server:
php artisan config:clear
php artisan cache:clear
npm install
npm run serve
and go to the http://127.0.0.1:8000
Credits
Note: All images are used for preview purpose only and not included in the final purchase files.
Images
Google Fonts
IconFont
Packages
Additional Notes
If you need more details, please refer to the written instructions.
Feel free to reach out to our support team if you have any questions!