Im using Laravel and Eloquent to relate two models.
Fairly simple, a webshop has many brands, but I have some extra information stored in the relation table that I need.
How do I get this?
My relation table looks like this:
brand_id | webshop_id | url
My current statement to get the webshops including the brands is:
$webshop = Webshop::select()
->where('slug', $slug)
->with('brands')
->first();
Then I can look through $webshop->brands but the column "url" is not accesable.