Hi
I have model with relation:
$u = $user->with('Articles')->first();
then i can get:
$u->articles[0];
$u->articles[1];
$u->articles[2];
Ho can i change array key of articles relation to id of the article? So i could get:
$u->articles[article_id];
Thanks in advanced!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community