Jerry/app/Http/Controllers/Api/customerController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return Response
     */
Remove the specified resource from storage.
@param  int  $id
@return Response
Remove the specified resource from storage . @param int $id @return Response
public function destroy($id)
    {
        $customer = Customer::find($id);
        if($customer) {
            try {
                $customer->delete();
                $this->_response = [
                    'error' => false,
                    'msg' => 'The client has been removed successfully',
                ];
            } catch (Exception $e) {
                $this->_response = [
                    'error' => true,
                    'msg' => $e->getMessage(),
                ];
            }            
        } else {
            $this->_response = [
                'error' => true,
                'msg' => 'The client was not found',
            ];
        }
        return response()->json($this->_response);
    }
public function destroy ( $ id ) { $ customer = Customer :: find ( $ id ) ; if ( $ customer ) { try { $ customer -> delete ( ) ; $ this -> _response = [ 'error' => false , 'msg' => 'The client has been removed successfully' , ] ; } catch ( Exception $ e ) { $ this -> _response = [ 'error' => true , 'msg' => $ e -> getMessage ( ) , ] ; } } else { $ this -> _response = [ 'error' => true , 'msg' => 'The client was not found' , ] ; } return response ( ) -> json ( $ this -> _response ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .