Note: The laravel application (including artisan commands) is located in the laravel-application
directory.
- Clone the repository
- Change directory to the
laravel-application
directory withcd laravel-application
- Run
composer install
- Run
npm install
- Duplicate
.env.example
and rename it to.env
, then fill in the appropriate environment variables - Run
php artisan migrate:fresh
to run the migrations, be careful that this is not over an existing database
- Run
npm run dev
to compile the assets (note with Laravel 9+ this is a continuous process and must be stopped with Ctrl+C) - Run
php artisan serve
to start the development server (this is also a continuous process and must be stopped with Ctrl+C)
- After running
php artisan serve
, you can create a user by visitinghttp://localhost:8000/register
- The database tables are located in the
laravel-application/database/migrations
directory - The models are located in the
laravel-application/app/Models
directory
- The admin navigation can be modified in the
laravel-application/config/admin-navigation.php
file
- To make a model manageable, add the
ManageableModel
trait to the model, and override the appropriate methods (Check theManageableModel
trait for more information) - A ManageableModel is a model that can be managed within the admin panel (Given the user has the correct permissions), they are added automatically to the admin panel navigation
isViewable
- Returns whether the model is viewable in the admin panelisCreatable
- Returns whether the model is creatable in the admin panelisEditable
- Returns whether the model is editable in the admin panelisDeletable
- Returns whether the model is deletable in the admin panelvalidate
- Returns the validation rules for the modelbrowseActions
- Returns the browse actions for the model (eg. Edit, Delete, etc.)onCreateHook
- Called when a model is createdonEditHook
- Called when a model is editedonDeleteHook
- Called when a model is deletedgetBrowsableColumns
- Returns the columns that are displayed in the browse viewgetManageableFields
- Returns the fields (ManageableField's) that are displayed in the create and edit views
ManageableField
s are used to define the fields that are displayed in the admin panel for a given model- To create a new
ManageableField
, add it to theManageableFields
directory, extend theManageableField
class and override the appropriate methods (Check theManageableField
class for more information)
__construct
- The constructor for the field, this is where you should set the field's base propertiesrender
- Returns the HTML for the field (by means of a view)getValue
- Returns the value for the field (This includes returning theold
value if the request fails validation)getLabel
- Returns the label for the field (This is a pretty name, displayed by default above the field)getPlaceholder
- Returns the placeholder for the field (This is a hint for the user, displayed by default inside the field)