src/Controllers/ScaffoldController.php
public function delete(Module $module)
    {
        $this->authorize('delete', $eloquent = app('scaffold.model'));

        $id = $eloquent->id;

        app('scaffold.actions')->exec('delete', [$eloquent]);

        $message = trans('administrator::messages.remove_success', ['item' => app('scaffold.module')->singular()]);

        if (URL::previous() === route('scaffold.view', ['module' => $module, 'id' => $id])) {
            return back()->with('messages', [$message]);
        }

        return redirect()->to(route('scaffold.index', ['module' => $module]))->with('messages', [$message]);
    }
public function delete(Module $module)
    {
        $this->authorize('delete', $eloquent = app('scaffold.model'));

        $id = $eloquent->id;

        app('scaffold.actions')->exec('delete', [$eloquent]);

        $message = trans('administrator::messages.remove_success', ['item' => app('scaffold.module')->singular()]);

        if (URL::previous() === route('scaffold.view', ['module' => $module, 'id' => $id])) {
            return back()->with('messages', [$message]);
        }

        return redirect()->to(route('scaffold.index', ['module' => $module]))->with('messages', [$message]);
    }
public function delete ( Module $ module ) { $ this -> authorize ( 'delete' , $ eloquent = app ( 'scaffold.model' ) ) ; $ id = $ eloquent -> id ; app ( 'scaffold.actions' ) -> exec ( 'delete' , [ $ eloquent ] ) ; $ message = trans ( 'administrator::messages.remove_success' , [ 'item' => app ( 'scaffold.module' ) -> singular ( ) ] ) ; if ( URL :: previous ( ) === route ( 'scaffold.view' , [ 'module' => $ module , 'id' => $ id ] ) ) { return back ( ) -> with ( 'messages' , [ $ message ] ) ; } return redirect ( ) -> to ( route ( 'scaffold.index' , [ 'module' => $ module ] ) ) -> with ( 'messages' , [ $ message ] ) ; }
Destroy item.

@param Module $module

@return \Illuminate\Http\RedirectResponse
Destroy item .