devfaysal / laravel-admin
Admin Dashboard for Laravel project
Installs: 336
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 1
Open Issues: 0
Language:JavaScript
Requires
- php: ^7.3
- illuminate/support: ^8.0
- laravel/ui: ^3.0
- rap2hpoutre/laravel-log-viewer: ^1.7
- spatie/laravel-permission: ^3.2
- yajra/laravel-datatables-oracle: ^9.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.3
README
Following packages/Libraries used
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Installation
You can install the package via composer:
composer require devfaysal/laravel-admin
Then add the following middleware to the $routeMiddleware
array in app/Http/kernel.php
'admin.auth' => \Devfaysal\LaravelAdmin\Http\Middleware\AdminAuthenticate::class, 'admin.guest' => \Devfaysal\LaravelAdmin\Http\Middleware\AdminRedirectIfAuthenticated::class, 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
Publish Assets
php artisan vendor:publish --tag=laravel-admin-public
Publish Seeds
php artisan vendor:publish --tag=laravel-admin-seeders
Run Migration
php artisan migrate
Run seeder
composer dump-autoload php artisan db:seed --class=LaravelAdminSeeder
Usage
php artisan serve
Then visit localhost:8000/admin/login
username: hello@faysal.me password: password
Additionally if you want to customize the blade view files and want to add other options and menu in the admin panel, you can publish the views and extend
php artisan vendor:publish --tag=laravel-admin-views
If you want to add menu items in the sidebar menu, you need to create a file named menus.blade.php
in your root view directoray.
It will automatically register menus in the sidebar.
For javascript and css, javascript.blade.php
and styles.blade.php
Dashboard modification
To update Dashboard, register /admin/dashboard
route and use your own controller and view.
If you want the current html design, check vendor folder and copy dashboard.blade.php file from resource/views
folder inside the package.
Blade components
Add a stats section component:
<x-laravel-admin::stats-section title="Another title"> <x-laravel-admin::stats-item count="50" label="Lorem" icon="fa fa-user"/> <x-laravel-admin::stats-item count="50" label="Lorem"/> <x-laravel-admin::stats-item count="50" label="Lorem"/> <x-laravel-admin::stats-item/> </x-laravel-admin::stats-section>
Form field components
<x-text-field name="text" value="Some Value" label="Text Field" tooltip="Tooltip" placeholder="lorem"/> <x-textarea-field name="textarea" value="Some Text" label="Textarea Field"/> <x-select-field name="select" :data="[1,2,3,4,5]" label="Select Field"/> <x-password-field name="password" label="Password Field"/> <x-number-field name="number" value="5" label="Number Field" min="0"/> <x-hidden-field name="hidden"/> <x-file-field name="file" label="File Field"/> <x-email-field name="email" value="email@example.com" label="Email Field"/> <x-date-field name="date" value="2020-12-12" label="Date Field"/> <x-checkbox-field name="checkbox" label="Checkbox Field" value="1"/>
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email hello@faysal.me instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.