V
public function users()
{
return $this->belongsToMany(User::class);
}
Size: a a a
V
public function users()
{
return $this->belongsToMany(User::class);
}
AI
AI
AI
AI
🎃
V
V
🎃
V
->where('author_id', $userId)```
->wherePivot('user_id', $userId)
->first(['id', 'name', 'email'])
->get()
->toArray();
V
AI
V
$boards = Board::with([
'users' => function($q) use ($userId) {
$q->wherePivot('user_id', $userId)
}
])
->where('author_id', $userId)
->first(['id', 'name', 'email'])
->get()
->toArray();
🎃
$boards = Board::with([
'users' => function($q) use ($userId) {
$q->wherePivot('user_id', $userId)
}
])
->where('author_id', $userId)
->first(['id', 'name', 'email'])
->get()
->toArray();
🎃
🎃
AI
$boards = Board::with([
'users' => function($q) use ($userId) {
$q->wherePivot('user_id', $userId)
}
])
->where('author_id', $userId)
->first(['id', 'name', 'email'])
->get()
->toArray();
AI
$boards = Board::with([
'users' => function($q) use ($userId) {
$q->wherePivot('user_id', $userId)
}
])
->where('author_id', $userId)
->first(['id', 'name', 'email'])
->get()
->toArray();