Skip to content

Update procedure v7.0.0 ​

In Exment v7.0.0, the Laravel version used by Exment will change.
Up to v6.x, we used Laravel 10, but as the security support period for Laravel 10 has ended, we will change to Laravel 12.
Laravel 11 is skipped, and the update is performed directly from Laravel 10 to Laravel 12.

The requirements of v7.0.0 are as follows. There is no change in the database requirements.

v6.xv7.0.0
PHP8.2 or higher8.2 or higher (^8.2.0)
Laravel1012
MySQL8.0 or higher8.0 or higher (no change)
MariaDB10.11 or higher10.11 or higher (no change)

If an error occurs during the update, please refer to Troubleshooting.

Warning: The admin library and its namespace have changed ​

Up to v6.x, Exment used the library "exceedone/laravel-admin" (namespace Encore\Admin).
Since this library does not support Laravel 12, Exment v7.0.0 uses "exceedone/exment-admin-core" (namespace ExmentAdminCore\Admin) instead.

Therefore, plugins, "config/admin.php", and source code that you have created or customized by yourself cannot be used as they are.
If a class of the old namespace is called, an error such as the following will occur after the update.

Class "Encore\Admin\Widgets\Box" not found

Only the beginning of the namespace changes. The class name, the method name and the arguments are the same as before.

v6.x or lowerv7.0.0
Encore\Admin\ExmentAdminCore\Admin\

(Examples of frequently used classes)

v6.x or lowerv7.0.0
Encore\Admin\FormExmentAdminCore\Admin\Form
Encore\Admin\Widgets\BoxExmentAdminCore\Admin\Widgets\Box
Encore\Admin\Widgets\FormExmentAdminCore\Admin\Widgets\Form
Encore\Admin\Widgets\Grid\GridExmentAdminCore\Admin\Widgets\Grid\Grid
Encore\Admin\Widgets\Grid\ToolsExmentAdminCore\Admin\Widgets\Grid\Tools
Encore\Admin\Auth\Database\AdministratorExmentAdminCore\Admin\Auth\Database\Administrator
Encore\Admin\Facades\AdminExmentAdminCore\Admin\Facades\Admin

The files to be corrected are as follows. Please correct them by the procedure described later.

※Helper functions such as "admin_url()" and "admin_toastr()" can be used as they are without any modification.
※Classes of Exment itself ("Exceedone\Exment...") are not changed.

(If you are using PHP8.1 or lower) How to update PHP version ​

Laravel 12 requires PHP 8.2 or higher.
If you are still using PHP 8.1 or lower, please update PHP before starting this procedure.
※As much as possible, back up Exment and the server environment before updating PHP.
※If it does not exist in the link below, we apologize for the inconvenience, but please do your own research and update your PHP version.

Laravel12 update preparation ​

  • Make sure composer version is 2.
    For confirmation procedures, please check here.

  • Please back up your Exment.
    For information on how to perform a backup, please check here.

Composer.json modification ​

  • Open composer.json directly under the folder.

  • Change the following description in "require".

#### PHP fix
- Revised
        "php": "^8.2.0",

#### Laravel framework fix
- Revised
        "laravel/framework": "^12.0",

#### Fixed Exment
- Revised
        "exceedone/exment": "^7.0.0",

#### Other related library version changes
## It is necessary to partially change the versions of related libraries listed in the Exment manual.
## Please change the following if any. If not, no modification is necessary.
- Revised
        "laravel/passport": "^12.0",
        "laravel/sanctum": "^4.0",
        "laravel/browser-kit-testing": "^7.2",
        "laravel/tinker": "^2.10",
        "laravel/ui": "^4.6",
        "lcobucci/jwt": "^5.6",
        "doctrine/dbal": "^4.0",
        "symfony/css-selector": "^7.0",

## The following libraries are used as they are in Laravel 12. If you are already using version 3.x, no modification is necessary.
        "league/flysystem-aws-s3-v3": "^3.0",
        "league/flysystem-azure-blob-storage": "^3.0",
        "league/flysystem-sftp": "^3.0",
  • Change the following description in "require-dev".
#### Fixed error report handler
- Revised
        "nunomaduro/collision": "^8.6",

#### PHP unit test fix
- Revised
        "phpunit/phpunit": "^11.5",

#### Update packages
- Revised
        "fakerphp/faker": "^1.24",
        "laravel/pint": "^1.18",
        "laravel/sail": "^1.41",
        "mockery/mockery": "^1.6",
        "spatie/laravel-ignition": "^2.9"
  • Please delete the following entries in "require" and "require-dev" if they exist.
    They do not support Laravel 12, and they are no longer used by Exment v7.0.0.
- delete
        "nesbot/carbon": "^2.XX",
        "laravelcollective/html": "XXXX",
        "exceedone/laravel-admin": "XXXX",
        "psr/simple-cache": "^2.0.0",
        "dms/phpunit-arraysubset-asserts": "XXXX",
        "facade/ignition": "XXXX",
        "fideloper/proxy": "XXXX",
        "arcanedev/no-captcha": "XXXX",
        "adldap2/adldap2-laravel": "XXXX",
        "adldap2/adldap2": "XXXX",

※Laravel 12 requires Carbon 3. If "nesbot/carbon" is fixed to version 2 in composer.json, composer update will fail.
※"exceedone/laravel-admin" and "laravelcollective/html" are no longer used in v7.0.0. If they are not written in composer.json, they are deleted automatically by "composer update".
※"arcanedev/no-captcha" does not support Laravel 12, so it is no longer used in v7.0.0. If you use Google reCAPTCHA in public forms, "google/recaptcha" is used instead. For the procedure, please check Command execution 1.
※"adldap2/adldap2-laravel" and "adldap2/adldap2" do not support Laravel 12 (no longer maintained), so they are no longer used in v7.0.0. If you use LDAP login, "directorytree/ldaprecord" is used instead. For the procedure, please check Command execution 1. The LDAP settings on the login settings screen do not need to be changed.
※If you had set "skip-ips" (IP addresses that skip reCAPTCHA) in "config/no-captcha.php", it is not used in v7.0.0. Set it again in "recaptcha_skip_ips" of "config/exment.php". For details, please see here.
※The admin library "exceedone/exment-admin-core" is installed automatically by "composer update" as a dependency of Exment v7.0.0. It does not need to be written in composer.json.
If you have already written "exceedone/exment-admin-core" in composer.json, delete it so that it does not conflict with the version required by Exment. (If its version is "*", you can leave it as it is.)
※If any other library that does not support Laravel 12 is written in composer.json, please delete it or change it to a version that supports Laravel 12.

Delete the cache files of the application ​

The information of the libraries used up to v6.x remains in the cache files under "bootstrap/cache".
If you leave them, the following error will occur after the update and Exment will not start at all.

Class "Encore\Admin\AdminServiceProvider" not found
  • Please delete the following two files. (They are created again automatically. If they do not exist, no work is required.)
bootstrap/cache/packages.php
bootstrap/cache/services.php

Command execution 1 ​

  • Run the following command.
# Update Laravel framework, Exment, and related libraries
composer update

※If the PHP of the server does not have the sodium extension, execute the following command.

composer update --ignore-platform-req=ext-sodium
  • (Only if you use Google reCAPTCHA in public forms) Run the following command.
    In v7.0.0, the Google reCAPTCHA library has been changed from "arcanedev/no-captcha" to "google/recaptcha". After running "composer update", please run the following command.
    If you do not run it, public forms with reCAPTCHA enabled cannot be submitted.
composer require google/recaptcha
  • (Only if you use LDAP login) Run the following command.
    In v7.0.0, the LDAP library has been changed from "adldap2/adldap2-laravel" to "directorytree/ldaprecord". After running "composer update", please run the following command.
    If you do not run it, you cannot log in with LDAP.
composer require directorytree/ldaprecord

About the folder structure of the application ​

Laravel 11 and later have a new folder structure, but Laravel 12 also supports the folder structure of Laravel 10 as it is.
Therefore, the following files created up to v6.x can be used as they are, and there is no need to rewrite them.

  • bootstrap/app.php
  • app/Http/Kernel.php
  • app/Console/Kernel.php
  • app/Exceptions/Handler.php
  • app/Http/Middleware/TrustProxies.php

※If you have customized your application yourself, please check the Laravel official upgrade guide.
In particular, if you have created your own migration that changes columns using the "change" method, all the attributes of the column must be described again in Laravel 11 or later.

app/Admin folder correction ​

The files in the "app/Admin" folder are created when Exment is installed.
Among them, "app/Admin/bootstrap.php" is read every time an Exment screen is displayed, so if the old namespace remains, an error is recorded in the log ("storage/logs/laravel.log") for every screen display, and the contents described in this file are no longer applied.

  • Open the following files and replace "Encore\Admin" with "ExmentAdminCore\Admin".
    • app/Admin/bootstrap.php
    • All files in the app/Admin/Controllers folder
php
// Before correction
Encore\Admin\Form::forget(['map', 'editor']);

// After correction
ExmentAdminCore\Admin\Form::forget(['map', 'editor']);

config/admin.php modification ​

"config/admin.php" describes the class names of the admin library, so please correct it.

  • Open "config/admin.php" directly under the project folder.
  • Replace all the character strings "Encore\Admin" in the file with "ExmentAdminCore\Admin".
    There are several places, such as "auth.providers.admin.model", "database.users_model", "database.roles_model", "database.permissions_model", "database.menu_model" and "grid_action_class".
php
// Before correction
                'model'  => Encore\Admin\Auth\Database\Administrator::class,

// After correction
                'model'  => ExmentAdminCore\Admin\Auth\Database\Administrator::class,
  • In addition, the following setting items have been added in v7.0.0. They do not exist in "config/admin.php" created up to v6.x, so please add them to match the initial setting file of v7.0.0.
php
    'auth' => [
        // ... add the following 4 items in the "auth" item
        'guard' => 'admin',
        'throttle_logins' => true,
        'throttle_attempts' => 5,
        'throttle_timeout' => 900,
    ],

※"guard" (singular) and "guards" (plural), which is already described, are different setting items.
"guards" is the item that defines the login method (driver and provider) for the admin screen, and it is already described in "config/admin.php" up to v6.x. Please leave "guards" as it is, and add only the 4 items above.

※Even if you do not add the 4 items above, there is no problem with the operation of Exment. If "guard" is not set, it operates as "admin". The lock function at the time of login failure operates with the mechanism of Exment itself ("EXMENT_MAX_ATTEMPTS" and "EXMENT_DECAY_MINUTES" in ".env". For details, please check here), so it does not depend on the setting above.

※Please correct "config/admin.php" by hand. If you overwrite it with the "vendor:publish" command, the settings of Exment (the screen name, the logo, the operation log settings, etc.) will return to the initial value.

Plugin and customized source code correction ​

If you have created a plugin yourself, or customized the source code yourself, please correct the namespace as described in Warning: The admin library and its namespace have changed.

  • Please replace "Encore\Admin" with "ExmentAdminCore\Admin" for the following files.
    • Plugin files placed in the "app/Plugins" folder
    • Plugins uploaded from "Administrator settings" → "Plugin"
    • Source code you customized yourself, such as the files under the "app" folder
php
// Before correction
use Encore\Admin\Widgets\Box;

// After correction
use ExmentAdminCore\Admin\Widgets\Box;
  • For the plugin uploaded from the screen, after correcting the source code, please compress it into a zip file again and upload it from "Administrator settings" → "Plugin".

※For the description method of the plugin, please check Plugin development.
※If you are using a plugin created by a third party, please check with the distributor whether it supports v7.0.0.
※In v7.0.0, the jQuery used on the admin screens changes to version 3 (3.7.1); v6 used jQuery 2.1.4. If a plugin (script) or your own JavaScript uses syntax removed in jQuery 3 (.size(), .load(function), $.browser, etc.), it will cause an error. Please update it to the jQuery 3 syntax.

(Only if you are using Laravel Sanctum) config/sanctum.php modification ​

Exment itself does not use Laravel Sanctum, so this work is not required in most cases.
If you use Sanctum in your own program, the key name of the "middleware" item of "config/sanctum.php" has been changed in Sanctum 4. (The old key name "verify_csrf_token" can also still be used.)
Open "config/sanctum.php" and modify it as below.

php
    'middleware' => [
        'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
        'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
        'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
    ],

Command execution 2 ​

  • Run the following command.
# Reflect Exment update contents
php artisan exment:update

# Clear cache
php artisan config:clear
php artisan route:clear
php artisan view:clear

※The assets (CSS, JavaScript, etc.) of the admin library are copied to "public/vendor/open-admin" by this command.
※The folder "public/vendor/laravel-admin" used up to v6.x is no longer used. You may delete it.

What to do if you have changed the file save destination ​

If you have changed the file save location, additional work may be required.
The detailed procedure is described here. Please check the contents.

Confirmation after the update ​

Please log in to Exment and confirm that the following screens are displayed normally.

  • Login screen and dashboard
  • Custom data list and new creation screen
  • "Administrator settings" screen

In addition, please open "storage/logs/laravel.log" and confirm that an error such as "Class "Encore\Admin\XXXX" not found" is not recorded.
As described above, there is a case where the screen is displayed normally but only the error is recorded in the log.

※A password hashed with a hashing cost different from the current setting ("BCRYPT_ROUNDS" in ".env") is re-hashed automatically the next time the user logs in with the password (logins by SSO and LDAP are not covered). No work is required.

Update completed ​

The update is now complete.

What to do if you have changed the file save location - details ​

The required steps differ depending on the settings you have made up to that point.
Please check each setting method and perform the work.

If the file is saved to FTP ​

Please add the function using the command below.

composer require league/flysystem-ftp ~3.0

If you were using your own file driver ​

If you are using a proprietary file driver, such as Dropbox, you will need to modify it.
Click here [For advanced users/developers] Please create your own file driver again according to the contents described in Adding your own driver.

Other Errors ​

"Your requirements could not be resolved to an installable set of packages" Error ​

  • This error occurs when a library that does not support Laravel 12 is described in composer.json.
  Problem 1
    - Root composer.json requires laravel/framework ^12.0 -> satisfiable by laravel/framework[v12.0.0, ...].
    - xxxxx/yyyyy zzzz requires illuminate/support ^10.0 -> found illuminate/support[v10.0.0, ...] but these were not loaded.
  • In this case, please check the library name displayed in the message, and delete it from composer.json or change it to a version that supports Laravel 12.
    After the correction, run "composer update" again.

"Class "Encore\Admin\AdminServiceProvider" not found" Error ​

  • Exment does not start at all, and the following error occurs both on the screen and in the "php artisan" command.
  In ProviderRepository.php line 205:

  Class "Encore\Admin\AdminServiceProvider" not found
  • The information of the old library remains in the cache file of the application. Please delete the following two files.
bootstrap/cache/packages.php
bootstrap/cache/services.php

"Class "ExmentAdminCore\Admin\AdminServiceProvider" not found" Error ​

  • The following error occurs while "composer update" is running (package:discover), and Exment does not start.
  Class "ExmentAdminCore\Admin\AdminServiceProvider" not found
  • This error occurs when the admin library "exceedone/exment-admin-core" is not installed correctly.
    Check the following, run "composer update" again, and confirm that it completes without errors.
    • "exceedone/exment" in "require" of composer.json is "^7.0.0", as described in Composer.json modification
    • If "exceedone/exment-admin-core" is written in composer.json, it has been deleted (unless its version is "*")
  • You can check whether the admin library is installed with the following command.
composer show exceedone/exment-admin-core

"Class "Encore\Admin\XXXX" not found" Error ​

  • This error occurs when the old namespace remains in "app/Admin", in "config/admin.php", in a plugin, or in the source code you customized.
  Error

  Class "Encore\Admin\Form" not found (app/Admin/bootstrap.php)
  Class "Encore\Admin\Widgets\Box" not found (plugin)

The screen is not displayed correctly after the update ​

  • The cache of the old version may remain.
    Please execute the following commands.
bash
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear