# Collection not generated in forest schema

**URL:** <https://community.forestadmin.com/t/collection-not-generated-in-forest-schema/6097>\
**Category:** Help me!\
**Created:** [March 20, 2023, 11:51am UTC](https://community.forestadmin.com/t/collection-not-generated-in-forest-schema/6097 "2023-03-20T11:51:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EFGP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/efgp/32/5240_2.png) [@EFGP](https://community.forestadmin.com/u/EFGP)\
**Post date:** [March 20, 2023, 11:51am UTC](https://community.forestadmin.com/t/collection-not-generated-in-forest-schema/6097/1 "2023-03-20T11:51:25Z")

</div>

## Feature(s) impacted

Listing of Collection in left menu

## Observed behavior

A collection does not show in the left menu after clicking “Edit Layout”. It’s also not present at all in the forestadmin\_schema.json, even though it is referenced from other collections in the schema.

## Expected behavior

The collection should appear in the forest schema.

## Failure Logs

## Context

Model below:

```javascript
<?php

namespace App\FavouritesLists;

use App\Models\User;
use App\Models\Artist;
use App\Models\ActivityLog;
use Illuminate\Database\Eloquent\Model;
use App\FavouritesLists\Favourites\Favourite;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use ForestAdmin\LaravelForestAdmin\Services\Concerns\ForestCollection;

class FavouritesList extends Model
{
    use HasFactory, ForestCollection;

    protected $table = 'favourites_lists';

    protected $fillable = [
        'name'
    ];

    public function favourites(): HasMany
    {
        return $this->hasMany(Favourite::class);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function artists(): HasManyThrough
    {
        return $this->hasManyThrough(Artist::class, Favourite::class, 'favourites_list_id', 'id', null, 'artist_id');
    }

    public function activityLogs()
    {
        return $this->morphMany(ActivityLog::class, 'activity_loggable');
    }
}

```

- Project name: …
- Team name: …
- Environment name: …
- Agent (forest package) name & version: PHP Laravel 1.2.3
- Database type: …
- Recent changes made on your end if any: …

---

<div class="post-metadata">

**Author:** ![anon21153075](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@anon21153075](https://community.forestadmin.com/u/anon21153075)\
**Post date:** [March 20, 2023, 1:23pm UTC](https://community.forestadmin.com/t/collection-not-generated-in-forest-schema/6097/3 "2023-03-20T13:23:30Z")

</div>

Hi @EFGP 👋,

By default, the agent fetches the models into the directory `app\Models`.

You can add other directories in addition to `app\Models` in the `forest.php` config.

Here is the link to the documentation for customize models directories structure: [Laravel specific settings - Developer guide](https://docs.forestadmin.com/documentation/how-tos/settings/laravel-specific-settings#customize-models-directory-structure)
