src/Clipboard.php
protected function constrainToSimpleAbility($query, $ability)
    {
        return $query->where(function ($query) use ($ability) {
            $query->where('name', $ability)->whereNull('entity_type');

            $query->orWhere(function ($query) use ($ability) {
                $query->where('name', '*')->where(function ($query) {
                    $query->whereNull('entity_type')->orWhere('entity_type', '*');
                });
            });
        });
    }
protected function constrainToSimpleAbility($query, $ability)
    {
        return $query->where(function ($query) use ($ability) {
            $query->where('name', $ability)->whereNull('entity_type');

            $query->orWhere(function ($query) use ($ability) {
                $query->where('name', '*')->where(function ($query) {
                    $query->whereNull('entity_type')->orWhere('entity_type', '*');
                });
            });
        });
    }
protected function constrainToSimpleAbility ( $ query , $ ability ) { return $ query -> where ( function ( $ query ) use ( $ ability ) { $ query -> where ( 'name' , $ ability ) -> whereNull ( 'entity_type' ) ; $ query -> orWhere ( function ( $ query ) use ( $ ability ) { $ query -> where ( 'name' , '*' ) -> where ( function ( $ query ) { $ query -> whereNull ( 'entity_type' ) -> orWhere ( 'entity_type' , '*' ) ; } ) ; } ) ; } ) ; }
Constrain the query to the given non-model ability.

@param  \Illuminate\Database\Eloquent\Builder  $query
@param  string  $ability
@return \Illuminate\Database\Eloquent\Builder
Constrain the query to the given non - model ability .