Skip to content

My personal Laravel admin starter with feature-rich, ready-to-use admin panel, user management, role-based access control (RBAC), dynamic menus, and an automatic CRUD generator.

License

Notifications You must be signed in to change notification settings

datfooldive/laravel-admin-starter

Repository files navigation

Laravel Admin Starter

Laravel Logo

A feature-rich, ready-to-use admin panel built on Laravel. It comes with pre-built functionalities for user management, role-based access control (RBAC), dynamic menu management, and an automatic CRUD generator to kickstart your projects.

Note

This project was initially created for personal use, but feel free to use and modify it for your own purposes.


About The Project

Laravel Admin Starter is a starter kit for building admin panels with Laravel. It provides a solid foundation with essential features already built-in, allowing you to focus on developing your application's unique features.

Built With

Core Features

  • Authentication: Secure login system.
  • User Management: CRUD operations for users.
  • Role & Permission Management: Control user access with roles and permissions, powered by spatie/laravel-permission.
  • Dynamic Menu: Menus are dynamically generated and filtered based on user roles.
  • Automatic CRUD Generator: A powerful make:crud command to generate complete CRUD operations (Controller, Model, Repository, Request, Views, and Migration) for any resource.
  • Datatables: Server-side datatables for efficient data presentation.
  • Export Data: Export data to Excel files.
  • Repository Pattern: Implements the repository pattern for data abstraction.

Getting Started

Prerequisites

  • PHP >= 8.2
  • Composer
  • Node.js & NPM

Installation

  1. Clone the repository
    git clone https://github.com/datfooldive/laravel-admin-starter.git
  2. Install dependencies
    composer install
    npm install
  3. Setup environment
    • Copy .env.example to .env
      cp .env.example .env
    • Generate application key
      php artisan key:generate
  4. Configure your database in the .env file.
  5. Run migrations
    php artisan migrate
  6. Seed Core Data Run this command to seed the database with essential data like roles, permissions, and menus.
    php artisan core:seed
  7. Create Super Admin (Production) For a production environment, it is recommended to create a super admin user manually:
    php artisan app:create-super-admin

    Note for Development: For development purposes, you can use the UserSeeder to create a set of default users (superadmin, admin, and user). This is not recommended for production.

    php artisan db:seed --class=UserSeeder
  8. Build assets
    npm run build
  9. Run the development server
    php artisan serve

Usage

Automatic CRUD Generation

To generate a new CRUD for a resource (e.g., Book), run the following command:

php artisan make:crud Book

This will generate the following files:

  • app/Http/Controllers/BookController.php
  • app/Models/Book.php
  • app/Repositories/BookRepository.php
  • app/Http/Requests/BookRequest.php
  • database/migrations/..._create_books_table.php
  • resources/views/book/ (index, create, edit, form, action blade files)

After running the command, you will need to:

  1. Define the schema in the generated migration file.
  2. Define the validation rules in app/Http/Requests/BookRequest.php.
  3. Define the form fields in resources/views/book/form.blade.php.
  4. Add the new route to routes/web.php.
  5. Add the menu item in the menus table in your database.

Core Data Seeding

If you modify the core seeder files (CategoryPermissionSeeder, MenuSeeder, RoleSeeder), you must run the core:seed command again to apply the changes.

php artisan core:seed

Author

Contributing

Feel free to contribute to this project. Any contributions you make are greatly appreciated.

Please open an issue or submit a pull request for any changes.

License

This project is open-sourced software licensed under the MIT license.

About

My personal Laravel admin starter with feature-rich, ready-to-use admin panel, user management, role-based access control (RBAC), dynamic menus, and an automatic CRUD generator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages