Answers for "laravel has many deep"

PHP
0

laravel has many deep

class User extends Model {
    use \Staudenmeir\EloquentHasManyDeep\HasRelationships;

    public function cards() {
        return $this->hasManyDeep(Card::class, [Subject::class, Deck::class]);
    }
}
Posted by: Guest on April-24-2021
0

laravel has many deep

//App\User;

public function cards()
{
    Card::whereHas('decks', function($q){
         return $q->whereHas('subjects', function($q){
            return $q->where('user_id', $this->id);
        });
    });
}
Posted by: Guest on April-24-2021
0

laravel has many deep

$user->cards()->get();
Posted by: Guest on April-24-2021

Code answers related to "laravel has many deep"

Browse Popular Code Answers by Language