Laravel agent upgrade to v3
This is the official documentation of the forestadmin/laravel-forestadmin
v2+ and forestadmin/symfony-forestadmin
PHP agents.
The purpose of this note is to help developers to upgrade their Laravel agent from v2 to v3. Please read carefully and integrate the following breaking changes to ensure a smooth update.
Upgrade the forestadmin/laravel-forestadmin agent to v3.
Please be aware that while Forest Admin make every effort to ensure that our platform updates are broadly compatible and offer detailed instructions for upgrading, Forest Admin cannot guarantee that custom code developed by the developers will always be compatible with new versions of our software. This includes any custom modifications or extensions to core functionalities, such as method overrides or custom integrations. It is the responsibility of the developers to review and test their custom code to ensure compatibility with each new version. Our team provides comprehensive upgrade guides to assist in this process, but these cannot encompass the unique customizations that may be present in each customer's environment. Therefore, Forest Admin strongly recommend establishing a thorough testing protocol for your specific customizations to safeguard against potential issues during the upgrade process.
This upgrade allows users to cache their Laravel configuration with the native command php artisan config:cache
Upgrading to v3
Before upgrading to v3, consider the below breaking changes.
As for any dependency upgrade, it's very important to test this upgrade in your testing environments. Not doing so could result in your admin panel being unusable.
To upgrade to version 3, follow these steps and then update your project as shown in the Breaking Changes section below.
Step 1: Install the new version
In your composer.json
file specify the new package version:
Then update the package with the following command:
Step 2: Publish the configuration files from our package to your application
At this stage you should have 2 new files in your application:
config/forest.php
forest/forest_admin.php
Step 3: Remove the old configuration file
Take any customization you may have done in the old configuration file config/forest_admin.php
and put it in the new one forest/forest_admin.php
. Then delete the old configuration file config/forest_admin.php
.
Step 4: Clear the cache
Step 5: Launch your app
Restart your application.
Breaking Changes
The previous configuration prevented caching the configuration in Laravel with the command php artisan config:cache
To comply with Laravel standards, agent configuration and settings are moved into 2 separate files.
Before
Settings
The settings are loaded into the package using the Laravel env()
helper.
Agent configuration
After
Settings
The settings are loaded from this new file using the Laravel config()
helper. In the Laravel ecosystem, if you use the env()
helper outside a configuration file, it returns null
if the configuration is cached.
Agent configuration
Last updated