I'm learning laravel since 2 weeks and I have some issues with my HasMany relation.
I have one folder and multiple files. Files belongs to one folder and on folder has many files.
I want to display all files inside in folder.
I get the ID from url and I "send" it to query
$folder = ManagementFolders::where('reference', $reference)->first();
After that, I want to display all files inside but my foreach doesn't work.
Property [file] does not exist on this collection instance.