public scopeWhereRecipient ( $query, |
||
$query | ||
$model | ||
return |
public function scopeWhereRecipient($query, $model)
{
return $query->where('recipient_id', $model->getKey())->where('recipient_type', $model->getMorphClass());
}