Laravel Eloquent Relationships: Many To Many (4/6)

preview_player
Показать описание

Official site

Twitter
Рекомендации по теме
Комментарии
Автор

Awesome classes I'm having! Nice job!
Question: If I wish to obtain a list of USERS belonging to each role, I would have to redeclare the belongsToMany() method in Role Model, right?! (calling it users likely)

tashriser
Автор

Exelent Lesson my friend .
I have a question, how can I get the filed - created_at from the table that is making the connection ?
I want know when the role was associated . thanks

murilolivorato
Автор

How can i insert data correctly here? i mean, i could make a model for the pivot table and insert data like: RoleUser::create(.... is that the way?

laraladilaralala
Автор

Dude nice channel!
i have a doubt abou how to retrieve articles that has 2 or more relationships together, i mean, i want to get the models with relationship A and B together, not a list from articles with, A and a list with B. i`m trying to query using eloquent 'tags' => function($query) { $query->whereIn('tag_id', [2, 1, 3])} but it seems not working at all.

RichardFeliciano
Автор

Dude, amazing videos and well axplained. greetings from Venezuela.

enmanuelduran
Автор

Lacks of how to declare everything in controllers and how to manage all edits with tinker via model

juliuszukauskas
Автор

How can we decide when we can use hasOne and where hasMany?

veenadanak
Автор

what if i want to add a field to the table that results to the many to many relationship?

jlcanizales
Автор

How to insert data into multiple tables(artiels, comments, countries, roles, role_user, users etc..) using forms...

theeduframe
Автор

please describe with role i am not getting it . i am having a problem relating to role ???

kamaljungswar
Автор

Undefined property: stdClass::$roles (View: pages\profile.blade.php), am I missing something?

cleon
Автор

Here is how I did it" return $this->belongsToMany('App\Tag', 'tags_questions', 'question_id', 'tag_id'); // tags_questions is my pivot table.

adnasium
welcome to shbcf.ru