For laravel models from namespace other than App\Models, data is not accessilble
- Model is visible in list of collections
- When trying to fetch data, there is error message “The request to your server either failed or returned invalid data.
Please check your console logs to get more information.”
- AJAX request which should return the data yields only “Server Error”
- Model data is disponible even for models from non-default namespace
Project name: Hector Mentoring - preprod
Team name: Operations
Environment name: Developement
Agent type & version: v1.0.0-beta.21 + Laravel Framework 9.3.1
Recent changes made on your end if any: API was updated with php artisan forest:send-apimap
Hi @tslominski, and welcome to our community
Currently we have a feature that could help you.
This feature fixes the namespace issue and offers the ability to have several directories for models (different of App\Models).
You can try this feature by adding this line into your composer.json
The config/forest.php has been slightly changed.
You can remove the
'models_namespace' key and replace
'models_directory' => env('MODEL_DIRECTORY', 'app/Models/') by
'models_directory' => ['app/Models'].
This feature is now available in the latest version (v1.1.1) of laravel-forestadmin.