public function scopeCausedBy(Builder $query, Model $causer)
    {
        return $query
            ->where('causer_type', $causer->getMorphClass())
            ->where('causer_id', $causer->getKey());
    }
public function scopeCausedBy(Builder $query, Model $causer)
    {
        return $query
            ->where('causer_type', $causer->getMorphClass())
            ->where('causer_id', $causer->getKey());
    }
public function scopeCausedBy ( Builder $ query , Model $ causer ) { return $ query -> where ( 'causer_type' , $ causer -> getMorphClass ( ) ) -> where ( 'causer_id' , $ causer -> getKey ( ) ) ; }
Scope a query to only include activities by a given causer.

@param \Igniter\Flame\Database\Builder $query
@param Model $causer

@return \Illuminate\Database\Eloquent\Builder
Scope a query to only include activities by a given causer .