# No Model found for collection ArtistList - Laravel SmartCollection

**URL:** <https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778>\
**Category:** Help me!\
**Created:** [January 3, 2023, 6:15pm UTC](https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778 "2023-01-03T18:15:26Z")\
**Posts on this page:** 4\
**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:** [January 3, 2023, 6:15pm UTC](https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778/1 "2023-01-03T18:15:26Z")

</div>

## Feature(s) impacted

Creating a smart collection following the guide in [Smart Collections | Developer Guide](https://docs.forestadmin.com/documentation/reference-guide/smart-collections)

## Observed behavior

On accessing the “Artist Lists” collection in the UI, errors and returns 500 error on api - No model found for collection ArtistList

I’ve also noticed the generated forest schema doesn’t have a class given for the virtual class artistList like it does the other classes - is that intended?

## Expected behavior

Displays collection in UI using artistList model

## Failure Logs

Can DM.

## Context

- Project name: …
- Team name: …
- Environment name: …
- Agent type & version: Laravel 1.2.2
- 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:** [January 4, 2023, 9:00am UTC](https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778/4 "2023-01-04T09:00:03Z")

</div>

Hi @EFGP 👋,

Could you share this model and its controller ?

For the .forestadmin-schema.json, this is normal because we don’t need the class name for a smart collection.

---

<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:** [January 4, 2023, 10:23am UTC](https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778/5 "2023-01-04T10:23:51Z")

</div>

I think that the issue come from the route declaration.  
The route was declared in api.php and by default all the routes in` api.php` has the prefix “api”.

Can you check if the route `forest/artistList` has the prefix “api” with the command `php artisan route:list` ?

If so, you can remove the prefix “api” in the `boot()` function of the `RouteServiceProvider.php` or declare this route in `web.php`.

---

<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:** [January 4, 2023, 11:40am UTC](https://community.forestadmin.com/t/no-model-found-for-collection-artistlist-laravel-smartcollection/5778/6 "2023-01-04T11:40:36Z")

</div>

Yep sorry didn’t notice that - that’s resolved it by moving the route definition into the web.php file rather than api.php so it doesn’t have the /api prefix.

I have another question about related data for SmartCollection but will open a new thread.
