"Uh oh, no collections found." In Laravel project

Feature(s) impacted

Setup/Models/Collections.

Observed behavior

Currently a new Forest Admin project setup. Upon authentication within the Forest Admin UI, I see “Uh oh, no collections found. The liana didn’t detect any collections.Please ensure to have models declared in your project. .”

Expected behavior

I expect to see my models populated in the UI.

Failure Logs

N/A

Context

.forestadmin-schema.json

    "meta": {
        "liana": "laravel-forestadmin",
        "liana_version": "1.2.2",
        "stack": {
            "database_type": "mysql",
            "orm_version": "0.0.1"
        }
    },
    "collections": []
}

./config/forest.php


return [
    'models_directory'    => [],
    'json_file_path'        => env('JSON_FILE_PATH', '.forestadmin-schema.json'),
    'send_apimap_automatic' => env('FOREST_SEND_APIMAP_AUTOMATIC', true),
    'api'                   => [
        'url'         => env('FOREST_URL', 'https://api.forestadmin.com'),
        'secret'      => env('FOREST_ENV_SECRET'),
        'auth-secret' => env('FOREST_AUTH_SECRET'),
    ],
    'included_models' => [
      \Platform\Modules\Users\Models\UserModel::class,
      \Platform\Modules\Users\Models\UserInvitationsModel::class,

      \Platform\Modules\Organization\Models\OrganizationModel::class,
      \Platform\Modules\Organization\Models\OrganizationProfileModel::class,
      \Platform\Modules\Organization\Models\OrganizationCandidateModel::class,
      \Platform\Modules\Organization\Models\OrganizationCandidateSalaryModel::class,

      \Platform\Modules\Candidate\Models\CandidateProfileModel::class,
      \Platform\Modules\Candidate\Models\WorkHistoryModel::class,

      \Platform\Modules\Job\Models\JobModel::class,
      \Platform\Modules\Job\Models\JobCandidateProgressModel::class,
      \Platform\Modules\Job\Models\JobCandidateModel::class,
      \Platform\Modules\Job\Models\JobCandidateOfferModel::class,
    ],
    'excluded_models' => [],
];
  • Project name: Distro
  • Team name: distro-platform
  • Environment name: local
  • Agent type & version: forestadmin/laravel-forestadmin:1.2.2
  • Recent changes made on your end if any: None

Hi @Jake_Toolson,

The included_models options only include the models present in the models_directory paths.

In your case, you must define ['Platform\Modules'] for the models_directory key in your configuration.

Thanks @nicolasa - Unfortunately, I still receive this error when I fill out the models_directory. I’ve tried many variations using namespaces and paths:

    'models_directory'    => [
      'src/Modules/Users/Models',
      'src/Modules/Organization/Models',
      'src/Modules/Candidate/Models',
      'src/Modules/Job/Models',
    ],
    'models_directory'    => [
      'Platform\Modules\Users\Models',
'Platform\Modules\Organization\Models',
      'Platform\Modules\Candidate\Models',
      'Platform\Modules\Job\Models',
    ],

(before changing each, I run php artisan forest:clear and php artisan forest:send-apimap

I’m marking this as resolved and deleting my other questions/issues as they are unrelated. Thanks.