Support the ongoing development of Laravel.io →
posted 4 years ago
Last updated 2 years ago.
0

Can you show the migration ?

Have you tried to dd($this) and see what data does the object have ?

k2oumais liked this reply

1

I dont have a migration, because the table is already filled in the database.

I found out that I wasnt calling the resource with a collection.

In the controller I just had to:

public function showCountries()
{
    return CountryResource::collection(
        Country::all()
    );
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Joao Alves k2oumais Joined 6 Apr 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.