- To Be Determined.
composer require devs_ryan/laravel-easy-admin
php artisan vendor:publish --tag="public" --provider="DevsRyan\LaravelEasyAdmin\LaravelEasyAdminServiceProvider"
php artisan migrate
(Your app is assumed to have a users table at this point)- Access from http(s)://your-project-url.com/easy-admin
The following optional URL variables can be set in the Laravel .env file:
APP_URL
(provides a link back to your app on the login page nav bar)EASY_ADMIN_APP_NAME
(Change the name shown in the top left of the Easy Admin nav bar)EASY_ADMIN_SUPPORT_EMAIL
(Provide a help email address to your Easy Admin users)EASY_ADMIN_DEFAULT_NAMESPACE
(Set true to user namespace App\Models)EASY_ADMIN_DEFAULT_PASSWORD
(This password will be set for any fields matchingpassword
during seed generation. Default issecret
)EASY_ADMIN_BASE_URL
(Change the base URL for your admin area. Default is `easy-admin)
php artisan easy-admin:create-user
- Follow the prompts to create a new user account with Easy Admin access
php artisan easy-admin:remove-user
- Follow the prompts to remove a user from the database
php artisan easy-admin:user
- Enter a user_id or email to grant access
php artisan easy-admin:user --remove
- Enter a user_id or email to remove access
After running this command a CRUD resource will be added to the Easy Admin UI for the model specified.
php artisan easy-admin:add-model
- Follow the prompts for namespace E.G. "App" and model name E.G. "User"
- This will generate a new file in the base projects app/EasyAdmin directory, where you can comment out any functionality you do not wish to provide to the Easy Admin UI
php artisan easy-admin:remove-model
- Follow the prompts for namespace E.G. "App" and model name E.G. "User"
- This will remove the model from showing in the UI and delete the app/EasyAdmin file for it as well
php artisan easy-admin:refresh-model
- Follow the prompts for namespace E.G. "App" and model name E.G. "User"
- This will reload the public file in the app/EasyAdmin directory to the default and load/remove any fields that have changed in the model
Add all models within a given namespace to Easy Admin
In case you would like to return Easy Admin to the original state, use the command below.
php artisan easy-admin:reset
Lists the supported image sizes that are generated when uploading an image file.
php artisan easy-admin:image-sizes
Used to retrieve an image that was created using Easy Admin (see size options using command above)
easyImg($model_name, $field_name, $file_name, $size = 'original')
Used to retrieve an image that was created using Easy Admin (with full image details, does not work with general storage)
easyImgDetails($model_name, $field_name, $file_name)
- Note: $field_name argument can be set to
null
orgeneral_storage
for WYSIWYG related images
Used to retrieve a file that was created using Easy Admin
easyFile($model_name, $field_name, $file_name)
Used to strip any HTML away from text for wysiwyg fields
easySafeText($blog_post->content)
This admin panel assumes that you follow the standard Laravel naming conventions for models and database tables. If you create migrations/models using php artisan make:model {ModelName} -m
it should work, otherwise it may not.
The users table is expected to contain some fields that ship with the Laravel base install, such as email
and password
.
All model resources must contain and id
attribute in their database table for the routing to function.
Laravel Easy Admin is open-sourced software licensed under the GNU Lesser General Public License v3.0.