src/Http/Controllers/FileController.php
public function downloadAll($crudeName = null, $id = null)
    {
        if (! $crudeName || ! $id)
            return redirect()->back();

        $crude = CrudeInstance::get($crudeName);
        if (! $crude)
            return redirect()->back();

        $model = $crude->getModel()->find($id);
        if (! $model)
            return redirect()->back();

        $filesZip = CrudeZip::run($model);
        if (! $filesZip)
            return redirect()->back();

        return response()->download($filesZip, $crudeName . '-' . $id . '.zip')->deleteFileAfterSend(true);
    }
public function downloadAll($crudeName = null, $id = null)
    {
        if (! $crudeName || ! $id)
            return redirect()->back();

        $crude = CrudeInstance::get($crudeName);
        if (! $crude)
            return redirect()->back();

        $model = $crude->getModel()->find($id);
        if (! $model)
            return redirect()->back();

        $filesZip = CrudeZip::run($model);
        if (! $filesZip)
            return redirect()->back();

        return response()->download($filesZip, $crudeName . '-' . $id . '.zip')->deleteFileAfterSend(true);
    }
public function downloadAll ( $ crudeName = null , $ id = null ) { if ( ! $ crudeName || ! $ id ) return redirect ( ) -> back ( ) ; $ crude = CrudeInstance :: get ( $ crudeName ) ; if ( ! $ crude ) return redirect ( ) -> back ( ) ; $ model = $ crude -> getModel ( ) -> find ( $ id ) ; if ( ! $ model ) return redirect ( ) -> back ( ) ; $ filesZip = CrudeZip :: run ( $ model ) ; if ( ! $ filesZip ) return redirect ( ) -> back ( ) ; return response ( ) -> download ( $ filesZip , $ crudeName . '-' . $ id . '.zip' ) -> deleteFileAfterSend ( true ) ; }
Download all files for model
Download all files for model