Laravel specific settings
Last updated
Last updated
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize
and forest-express-mongoose
Node.js agents that will soon reach end-of-support.
forest-express-sequelize
v9 and forest-express-mongoose
v9 are replaced by v1.
Please check your agent type and version and read on or switch to the right documentation.
If you would like to publish the configuration of the package, you can run the following command:
When you want to deploy your forest admin to production (or other branch different of your local environment), you must run the following command:
This command must be run each time you deploy your application on production.
But you can avoid it and activate the mode "apimap send auto" with the environment variable FOREST_SEND_APIMAP_AUTOMATIC
.
You have 2 solutions:
add FOREST_SEND_APIMAP_AUTOMATIC
to your .env file and set to true
publish your configuration and set to true the send_apimap_automatic
into config/forest.php
However, beware that if you activate this configuration, you must refresh your forest dashboard after you deploy on production.
Depending on your configuration, refreshing the whole application may take a few seconds after your deployment. Using the environment variable is recommended for small projects, whereas the php artisan command is better suited when dealing with bigger projects.
When using Laravel Valet, you must configure to SSL.
Then declare the corresponding url in your .env file into the APP_URL variable.
Don't forget the S of https
The agent fetches the models into the directory specified by the models_directory
configuration.
All class files that doesn't extends the Illuminate\Database\Eloquent\Model are ignored.
By default, the value is the main models directory of Laravel 'app/Models', but you can change this configuration and add one or more models directories.
Example
You don't have to specify all the subdirectories, the agent will retrieve them for you. For example, imagine with the directory structure : app/StripeModels/Billing
& app/StripeModels/Orders
, you have just to specify the main directory app/StripeModels
.
With Laravel Valet the apimap is not updated automatically. We recommend that you set your environment variable FOREST_SEND_APIMAP_AUTOMATIC to true. More information in the previous chapter
You can also include/exclude models. More information