classes/Controllers/Base.php
public function destroy($id)
    {
        // Find the item
        $item = $this->findOrFail($id);

        // Delete row (this should trigger file attachment deletes as well)
        $item->delete();

        // As long as not an ajax request, go back to the parent directory of the referrer
        if (Request::ajax()) {
            return Response::json();
        } else {
            return Redirect::to(DecoyURL::relative('index'))
            ->with('success', $this->successMessage($item, 'deleted'));
        }
    }
public function destroy($id)
    {
        // Find the item
        $item = $this->findOrFail($id);

        // Delete row (this should trigger file attachment deletes as well)
        $item->delete();

        // As long as not an ajax request, go back to the parent directory of the referrer
        if (Request::ajax()) {
            return Response::json();
        } else {
            return Redirect::to(DecoyURL::relative('index'))
            ->with('success', $this->successMessage($item, 'deleted'));
        }
    }
public function destroy ( $ id ) { // Find the item $ item = $ this -> findOrFail ( $ id ) ; // Delete row (this should trigger file attachment deletes as well) $ item -> delete ( ) ; // As long as not an ajax request, go back to the parent directory of the referrer if ( Request :: ajax ( ) ) { return Response :: json ( ) ; } else { return Redirect :: to ( DecoyURL :: relative ( 'index' ) ) -> with ( 'success' , $ this -> successMessage ( $ item , 'deleted' ) ) ; } }
Destroy a record

@param  int                                       $id Model key
@return Symfony\Component\HttpFoundation\Response Redirect to listing
Destroy a record