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.
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.
- 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:crudcommand 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.
- PHP >= 8.2
- Composer
- Node.js & NPM
- Clone the repository
git clone https://github.com/datfooldive/laravel-admin-starter.git
- Install dependencies
composer install npm install
- Setup environment
- Copy
.env.exampleto.envcp .env.example .env
- Generate application key
php artisan key:generate
- Copy
- Configure your database in the
.envfile. - Run migrations
php artisan migrate
- Seed Core Data
Run this command to seed the database with essential data like roles, permissions, and menus.
php artisan core:seed
- 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
UserSeederto create a set of default users (superadmin, admin, and user). This is not recommended for production.php artisan db:seed --class=UserSeeder
- Build assets
npm run build
- Run the development server
php artisan serve
To generate a new CRUD for a resource (e.g., Book), run the following command:
php artisan make:crud BookThis will generate the following files:
app/Http/Controllers/BookController.phpapp/Models/Book.phpapp/Repositories/BookRepository.phpapp/Http/Requests/BookRequest.phpdatabase/migrations/..._create_books_table.phpresources/views/book/(index, create, edit, form, action blade files)
After running the command, you will need to:
- Define the schema in the generated migration file.
- Define the validation rules in
app/Http/Requests/BookRequest.php. - Define the form fields in
resources/views/book/form.blade.php. - Add the new route to
routes/web.php. - Add the menu item in the
menustable in your database.
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- datfooldive - https://github.com/datfooldive
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.
This project is open-sourced software licensed under the MIT license.