src/Console/CleanCommand.php
protected function deleteOrphanedAbilities()
    {
        $query = $this->getBaseOrphanedQuery()->where(function ($query) {
            foreach ($this->getEntityModels() as $modelName) {
                $query->orWhere(function ($query) use ($modelName) {
                    $this->scopeQueryToWhereModelIsMissing($query, $modelName);
                });
            }
        });

        if (($count = $query->count()) > 0) {
            $query->delete();

            $this->info("Deleted {$count} orphaned ".Str::plural('ability', $count).'.');
        } else {
            $this->info('No orphaned abilities.');
        }
    }
protected function deleteOrphanedAbilities()
    {
        $query = $this->getBaseOrphanedQuery()->where(function ($query) {
            foreach ($this->getEntityModels() as $modelName) {
                $query->orWhere(function ($query) use ($modelName) {
                    $this->scopeQueryToWhereModelIsMissing($query, $modelName);
                });
            }
        });

        if (($count = $query->count()) > 0) {
            $query->delete();

            $this->info("Deleted {$count} orphaned ".Str::plural('ability', $count).'.');
        } else {
            $this->info('No orphaned abilities.');
        }
    }
protected function deleteOrphanedAbilities ( ) { $ query = $ this -> getBaseOrphanedQuery ( ) -> where ( function ( $ query ) { foreach ( $ this -> getEntityModels ( ) as $ modelName ) { $ query -> orWhere ( function ( $ query ) use ( $ modelName ) { $ this -> scopeQueryToWhereModelIsMissing ( $ query , $ modelName ) ; } ) ; } } ) ; if ( ( $ count = $ query -> count ( ) ) > 0 ) { $ query -> delete ( ) ; $ this -> info ( "Deleted {$count} orphaned " . Str :: plural ( 'ability' , $ count ) . '.' ) ; } else { $ this -> info ( 'No orphaned abilities.' ) ; } }
Delete model abilities whose models have been deleted.

@return void
Delete model abilities whose models have been deleted .