public static function destroy($identifiers)
    {
        // We'll initialize a count here so we will return the total number of deletes
        // for the operation. The developers can then check this number as a boolean
        // type value or get this total count of records deleted for logging, etc.
        $count = 0;

        $identifiers = is_array($identifiers) ? $identifiers : func_get_args();

        $key = ($instance = new static)->getKeyName();

        collect($identifiers)->map(function ($identifier) use ($instance, $key) {
            return $instance->forceFill([$key => $identifier]);
        })->each(function ($model) use (&$count) {
            $model->delete() ? $count++ : $count;
        });

        return $count;
    }
public static function destroy($identifiers)
    {
        // We'll initialize a count here so we will return the total number of deletes
        // for the operation. The developers can then check this number as a boolean
        // type value or get this total count of records deleted for logging, etc.
        $count = 0;

        $identifiers = is_array($identifiers) ? $identifiers : func_get_args();

        $key = ($instance = new static)->getKeyName();

        collect($identifiers)->map(function ($identifier) use ($instance, $key) {
            return $instance->forceFill([$key => $identifier]);
        })->each(function ($model) use (&$count) {
            $model->delete() ? $count++ : $count;
        });

        return $count;
    }
public static function destroy ( $ identifiers ) { // We'll initialize a count here so we will return the total number of deletes // for the operation. The developers can then check this number as a boolean // type value or get this total count of records deleted for logging, etc. $ count = 0 ; $ identifiers = is_array ( $ identifiers ) ? $ identifiers : func_get_args ( ) ; $ key = ( $ instance = new static ) -> getKeyName ( ) ; collect ( $ identifiers ) -> map ( function ( $ identifier ) use ( $ instance , $ key ) { return $ instance -> forceFill ( [ $ key => $ identifier ] ) ; } ) -> each ( function ( $ model ) use ( & $ count ) { $ model -> delete ( ) ? $ count ++ : $ count ; } ) ; return $ count ; }
Destroy the models for the given identifiers.

@param  array|mixed  $identifiers
@return int
Destroy the models for the given identifiers .