jjanampa / laravel-admin
Laravel admin dashboard
Installs: 431
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 6
Forks: 5
Open Issues: 0
Language:CSS
Requires
- php: ^7.1|^8.0
- illuminate/support: ^5.5|^6.0|^7.0|^8.0
- laravel/ui: ^2.0|^3.0
- laravelcollective/html: ^6.0
- nwidart/laravel-modules: ^6.2|^7.0|^8.0
- spatie/laravel-activitylog: ^3.9
README
Laravel Admin is a drop-in admin panel package for Laravel which promotes rapid scaffolding & development, uses Material Dashboard
-
The project is based on the Laravel Admin Panel and Material Dashboard Laravel.
-
This package has a modular approach, for which it uses the Laravel module, see the documentation for more information on this approach: https://github.com/nWidart/laravel-modules
-
Installing this package will publish the
Admin
module in theModules
folder at the root of your project.
Requirements
Laravel >=7
PHP >= 7.0
Features:
- Admin User, Role & Permission Manager:
- Activity Log:
- Page CRUD:
- Settings:
- Login, Forgot Password
- Profile
Packages used:
Assets used:
Installation
After initializing instance of Laravel
-
Autoloading: By default, module classes are not loaded automatically. You can autoload your modules using
psr-4
, add"Modules\\": "Modules/"
in composer.json.{ "autoload": { "psr-4": { "App\\": "app/", "Modules\\": "Modules/", } } }
Tip: don't forget to run
composer dump-autoload
afterwards. -
Run
composer require jjanampa/laravel-admin
-
Install the admin package.
php artisan laravel-admin:install
Service provider will be discovered automatically.
execute
php artisan laravel-admin:install --force
to force the installation, this process recreate theAdmin
module, removes and recreates the following tables:admin_users, admin_roles, admin_permissions, admin_permission_role, admin_role_user, pages, settings
Logging In
Visit (APP_URL)/admin
to access the admin panel.
The default admin login is:
Email Address: admin@admin.com
Password: secret
Usage
-
Create some permissions.
-
Create some roles.
-
Assign permission(s) to role.
-
Create user(s) with role.
-
For checking authenticated user's role see below:
// Check role anywhere if (auth('admin')->user()->hasRole('editor')) { // Do admin stuff here } else { // Do nothing } // Check role in route middleware Route::resource('pages', 'Dashboard\PagesController')->middleware('role:editor');
-
For checking permissions see below:
if (auth('admin')->user()->can('permission-name')) { // Do something }
Learn more about ACL from here
For activity log please read spatie/laravel-activitylog
docs