laravel has many deep

Solutions on MaxInterview for laravel has many deep by the best coders in the world

showing results for - "laravel has many deep"
Christian
07 Jun 2019
1class User extends Model {
2    use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
3
4    public function cards() {
5        return $this->hasManyDeep(Card::class, [Subject::class, Deck::class]);
6    }
7}
8
Joshua
23 Apr 2016
1//App\User;
2
3public function cards()
4{
5    Card::whereHas('decks', function($q){
6         return $q->whereHas('subjects', function($q){
7            return $q->where('user_id', $this->id);
8        });
9    });
10}
11
Alia
16 Apr 2020
1$user->cards()->get();
2