src/Console/CleanCommand.php
protected function scopeQueryToWhereModelIsMissing($query, $modelName)
    {
        $model = new $modelName;
        $table = $this->abilitiesTable();

        $query->where("{$table}.entity_type", $modelName);

        $query->whereNotIn("{$table}.entity_id", function ($query) use ($modelName) {
            $model = new $modelName;
            $table = $model->getTable();

            $query->from($table)->select($table.'.'.$model->getKeyName());
        });
    }
protected function scopeQueryToWhereModelIsMissing($query, $modelName)
    {
        $model = new $modelName;
        $table = $this->abilitiesTable();

        $query->where("{$table}.entity_type", $modelName);

        $query->whereNotIn("{$table}.entity_id", function ($query) use ($modelName) {
            $model = new $modelName;
            $table = $model->getTable();

            $query->from($table)->select($table.'.'.$model->getKeyName());
        });
    }
protected function scopeQueryToWhereModelIsMissing ( $ query , $ modelName ) { $ model = new $ modelName ; $ table = $ this -> abilitiesTable ( ) ; $ query -> where ( "{$table}.entity_type" , $ modelName ) ; $ query -> whereNotIn ( "{$table}.entity_id" , function ( $ query ) use ( $ modelName ) { $ model = new $ modelName ; $ table = $ model -> getTable ( ) ; $ query -> from ( $ table ) -> select ( $ table . '.' . $ model -> getKeyName ( ) ) ; } ) ; }
Scope the given query to where the ability's model is missing.

@param  \Illuminate\Database\Query\Builder  $query
@param  string  $modelName
@return void
Scope the given query to where the ability s model is missing .