cyberfly
9/21/2018 - 9:37 AM

Eloquent multiple delete by id

/**
     * Delete specific media attachments, pass array of model ID
     * @param $deleted_files
     * @internal param $deleted_files
     */
    public function deleteAttachments($deleted_files)
    {
        Media::find($deleted_files)
            ->each
            ->delete();
    }