Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,461 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Starter - A CMS like modular starter project built with the latest Laravel framework.

Laravel Starter (based on Laravel 12.x)

Laravel Starter is a Laravel 12.x based simple starter project. Most of the commonly needed features of an application like Authentication, Authorisation, Users and Role management, Application Backend, Backup, Log viewer are available here. It is modular, so you may use this project as a base and build your own modules. A module can be used in any Laravel Starter based project. Here Frontend and Backend are completely separated with separate routes, controllers, and themes as well.

Repository: https://github.com/vasuquantdev/laravel-starter

Please let me know your feedback and comments.

Latest Stable Version StyleCI Build License PHP Version Require

Reporting a Vulnerability

If you discover any security-related issues, please send an e-mail to Nasir Khan Saikat via nasir8891@gmail.com instead of using the issue tracker.

Appplication Demo

Check the following demo project. It is just a straight installation of the project without any modification.

Demo URL: https://laravel.nasirkhn.com

You may use the following account credentials to access the application backend.

User: super@admin.com
Pass: secret

User: user@user.com
Pass: secret

Demo Data

For detailed information about seeding options and demo data management, see the Database Seeding section above.

Quick command to add demo data:

php artisan laravel-starter:insert-demo-data

Use --fresh to truncate existing data first:

php artisan laravel-starter:insert-demo-data --fresh

Custom Commands

We have created a number of custom commands for the project. The commands are listed below with a brief about their use of it.

Create New module

To create a project use the following command, you have to replace the MODULE_NAME with the name of the module.

php artisan module:build MODULE_NAME

You may want to use --force option to overwrite the existing module. if you use this option, it will replace all the existing files with the default stub files.

php artisan module:build MODULE_NAME --force

Clear All Cache

composer clear-all

this is a shortcut command to clear all cache including config, route, and more

Code Style Fix

We are now using Laravel Pint to make the code style stay as clean and consistent as the Laravel Framework. Use the following command to apply CS-Fix.

composer pint

Along with Laravel Pint, we are using prettier to format the blade templates. You can install the prettier extension in your favorite editor. The following command will format the blade templates.

npm run format

or if you are using yarn then you can use the following command.

yarn format

Role - Permissions

Several custom commands are available to add and update role-permissions. Please read the Role - Permission Wiki page, where you will find the list of commands with examples.

Features

The Laravel Starter comes with several features which are the most common in almost all applications. It is a template project which means it is intended to be built in a way that it can be used for other projects.

It is a modular application, and some modules are installed by default. It will be helpful to use it as a base for future applications.

  • Admin feature and public views are completely separated as Backend and Frontend namespace.
  • Major features are developed as Modules. A module like Posts, Comments, and Tags are separated from the core features like User, Role, Permission

Core Features

  • User Authentication
  • Social Login
    • Google
    • Facebook
    • Github
    • Build in a way adding more is much easier now
  • User Profile with Avatar
  • Role-Permissions for Users
  • Dynamic Menu System
  • Language Switcher
  • Localization enabled across the project
  • Backend Theme
    • Bootstrap 5, CoreUI
    • Fontawesome 6
    • Dark Mode
  • Frontend Theme
    • Tailwind
    • Fontawesome 6
    • Dark Mode
  • Article Module
    • Posts
    • Categories
    • Tags
    • Comments
    • wysiwyg editor
    • File browser
  • Application Settings
  • External Libraries
    • Bootstrap 5
    • Fontawesome 6
    • CoreUI
    • Tailwind
    • Datatables
    • Select2
    • Date Time Picker
  • Backup (Source, Files, Database as Zip)
  • Log Viewer
  • Notification
    • Dashboard and details view

Project Structure

This project follows a modular Laravel architecture with a clear separation between the public Frontend, the admin Backend, and self-contained Modules.

laravel-starter/
├── app/                              # Core application logic
│   ├── Console/Commands/             # Custom Artisan commands
│   ├── Events/                       # Application events
│   ├── Http/
│   │   ├── Controllers/
│   │   │   ├── Auth/                   # Authentication & social login
│   │   │   ├── Backend/                # Admin panel controllers
│   │   │   └── Frontend/               # Public-facing controllers
│   │   └── Middleware/                 # HTTP middleware
│   ├── Listeners/                      # Event listeners
│   ├── Livewire/
│   │   ├── Auth/                       # Auth Livewire components
│   │   ├── Backend/                    # Admin Livewire components
│   │   └── Frontend/                   # Public Livewire components
│   ├── Models/                         # Core Eloquent models (User, Role, etc.)
│   ├── Notifications/                  # Email & system notifications
│   ├── Observers/                      # Model observers
│   ├── Providers/                      # Service providers
│   └── Traits/                         # Shared application traits
│
├── Modules/                            # Self-contained feature modules
│   ├── Category/                       # Category management
│   ├── Menu/                           # Dynamic menu & navigation
│   ├── Post/                           # Blog posts & content
│   └── Tag/                            # Tagging system
│
├── bootstrap/                          # Application bootstrap
├── config/                             # Application & package configuration
├── database/
│   ├── factories/                      # Model factories
│   ├── migrations/                     # Core database migrations
│   └── seeders/                        # Essential & demo data seeders
│
├── docs/                               # Supplemental documentation
├── lang/                               # Localization (en, bn, fa, tr, vi)
├── public/                             # Web root & static assets
├── resources/
│   ├── css/                            # Stylesheets (backend & frontend)
│   ├── js/                             # JavaScript entry points
│   ├── sass/                           # SCSS for admin theme
│   └── views/
│       ├── backend/                    # Admin Blade templates
│       ├── frontend/                   # Public Blade templates
│       ├── livewire/                   # Livewire view templates
│       ├── layouts/                    # Shared layouts
│       └── components/                 # Reusable UI components
│
├── routes/
│   ├── auth.php                        # Authentication routes
│   ├── console.php                     # Console / scheduled commands
│   └── web.php                         # Web routes
│
├── storage/                            # Logs, cache, uploads (gitignored)
├── tests/
│   ├── Feature/                        # Feature & integration tests
│   └── Unit/                           # Unit tests
│
├── docker-compose.yml                  # Laravel Sail (Docker) setup
├── modules_statuses.json               # Module enable/disable registry
├── tailwind.config.ts                  # Tailwind CSS configuration
└── vite.config.js                      # Frontend asset bundling (Vite)

Module Layout

Each module under Modules/ follows a consistent, portable structure:

Modules/{ModuleName}/
├── Config/                             # Module-specific configuration
├── Console/Commands/                 # Module Artisan commands
├── database/
│   ├── factories/                      # Module model factories
│   ├── migrations/                     # Module database migrations
│   └── seeders/                        # Module seeders
├── Enums/                              # Module enums (where applicable)
├── Events/                             # Module events (where applicable)
├── Http/Controllers/
│   ├── Backend/                        # Admin CRUD controllers
│   └── Frontend/                       # Public controllers
├── lang/                               # Module translations
├── Models/                             # Module Eloquent models
├── Providers/                          # Module service providers
├── Resources/views/
│   ├── backend/                        # Admin views
│   └── frontend/                       # Public views
├── routes/web.php                      # Module routes
├── module.json                         # Module metadata & registration
└── composer.json                       # Module autoloading

Key Conventions

Area Convention
Namespaces Backend and Frontend namespaces separate admin and public code
Modules Feature domains live in Modules/ and can be enabled via modules_statuses.json
Views Core views in resources/views/; module views in Modules/{Name}/Resources/views/
Assets Backend uses Bootstrap/CoreUI (resources/sass/); Frontend uses Tailwind (resources/css/)
Auth Routes in routes/auth.php; controllers in app/Http/Controllers/Auth/
Testing Feature tests mirror app structure under tests/Feature/

User Guide

Installation

Follow the steps mentioned below to install and run the project. You may find more details about the installation in Installation Wiki.

  1. Clone the repository and install dependencies:
git clone https://github.com/vasuquantdev/laravel-starter.git
cd laravel-starter
composer install
  1. The default database is sqlite, if you want to change please update the database settings at .env file
  2. To create a link from the storage directory, run the following command from the project root:
php artisan storage:link
  1. You may create a virtualhost entry to access the application or run php artisan serve from the project root and visit http://127.0.0.1:8000

After creating the new permissions use the following commands to update cashed permissions.

php artisan cache:forget spatie.permission.cache

Database Seeding

This Laravel application provides flexible database seeding options to accommodate different development scenarios.

Types of Seeders

Essential Seeders (Always Run)

  • Users, Roles & Permissions (AuthTableSeeder)
  • Menu & Navigation (MenuDatabaseSeeder)

These seeders create the core data required for the application to function properly.

Dummy Data Seeders (Optional)

  • Posts (PostDatabaseSeeder)
  • Categories (CategoryDatabaseSeeder)
  • Tags (TagDatabaseSeeder)

These seeders create sample content for development and testing purposes.

Seeding Options

1. Full Seeding (Default)

Seeds both essential data and dummy data:

php artisan migrate:fresh --seed

2. Essential Data Only

Option A: Environment Variable Set in your .env file:

SEED_DUMMY_DATA=false

Then run:

php artisan migrate:fresh --seed

Option B: Custom Command

# Seed only essential data
php artisan db:seed-essential

# Fresh migration + essential data only
php artisan db:seed-essential --fresh

Option C: Runtime Environment Variable (PowerShell)

$env:SEED_DUMMY_DATA="false"; php artisan migrate:fresh --seed

3. Dummy Data Only

If you already have essential data and only want to add dummy content:

php artisan db:seed --class="Modules\Post\database\seeders\PostDatabaseSeeder"
php artisan db:seed --class="Modules\Category\database\seeders\CategoryDatabaseSeeder"
php artisan db:seed --class="Modules\Tag\database\seeders\TagDatabaseSeeder"

4. On-Demand Demo Data Insertion

If you need to add or refresh demo data after initial setup:

php artisan laravel-starter:insert-demo-data

This command inserts demo data for posts, categories, tags, and comments. Use the --fresh option to truncate existing data first:

php artisan laravel-starter:insert-demo-data --fresh

This is separate from the seeding process and can be used anytime to populate or refresh demo content.

Environment Configuration

.env Variables

# Control dummy data seeding (default: true)
SEED_DUMMY_DATA=true

Production Considerations

  • Essential seeders are safe for production (users, roles, menus)
  • Dummy data seeders should typically be disabled in production
  • Use --force flag for production environments:
php artisan db:seed-essential --fresh --force

Module Status Control

Individual modules can be enabled/disabled via modules_statuses.json:

{
    "Post": true,     // Dummy data module
    "Category": true, // Dummy data module
    "Tag": true,      // Dummy data module
    "Menu": true      // Essential module
}

Testing Environment

During automated testing:

  • Seeder output is suppressed to keep test logs clean
  • Both essential and dummy data are seeded by default
  • Override with SEED_DUMMY_DATA=false for faster test execution

Examples

Development Setup

# Full development environment with sample content
php artisan migrate:fresh --seed

Production Deployment

# Production with only essential data
SEED_DUMMY_DATA=false php artisan migrate:fresh --seed --force

Quick Development Reset

# Reset with only essential data for clean slate
php artisan db:seed-essential --fresh

Staging Environment

# Add sample content to existing essential data
SEED_DUMMY_DATA=true php artisan db:seed

Docker and Laravel Sail

This project is configured with Laravel Sail (https://laravel.com/docs/sail). You can use all the docker functionalities here. To install using docker and sail:

  1. Clone the repository: git clone https://github.com/vasuquantdev/laravel-starter.git
  2. Go to the project directory and run composer install
  3. Create .env file by copying the .env-sail. You may use the command to do that cp .env-sail .env
  4. Update the database name and credentials in .env file
  5. Run the command sail up (consider adding this to your alias: alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail')
  6. Run the command sail artisan migrate --seed
  7. Link storage directory: sail artisan storage:link
  8. Since Sail is already up, you can just visit http://localhost:80

Screenshots

Home Page

Laravel Starter Homepage Dark Mode Laravel Starter Homepage

Login Page

Laravel Starter Login

Posts Page

Laravel Starter Posts Page

Backend Dashboard

Laravel Starter Admin Dashboard Dark Mode Laravel Starter Admin Dashboard


Laravel Starter Posts List


Edit-Posts-Laravel-Starter

About

Laravel Starter is a Laravel 12.x based simple starter project. Most of the commonly needed features of an application like Authentication, Authorisation, Users and Role management, Application Backend, Backup, Log viewer are available here. It is modular, so you may use this project as a base and build your own modules.

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages