app/Http/Controllers/SupplierController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Supplier  $supplier
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Supplier $supplier)
    {
        $this->authorize('delete-permission', $supplier);
        try{
            $supplier->delete();
            return redirect()->route("supplier.index")->with("status", "Data supplier is deleted!");
        }
        catch(\PDOException $e){
            $msg = "Failed to delete. Make sure data child has been deleted or foreign key not connected";
            return redirect()->route('supplier.index')->with('error', $msg);
        }
    }
public function destroy ( Supplier $ supplier ) { $ this -> authorize ( 'delete-permission' , $ supplier ) ; try { $ supplier -> delete ( ) ; return redirect ( ) -> route ( " supplier.index " ) -> with ( " status " , " Data supplier is deleted! " ) ; } catch ( \ PDOException $ e ) { $ msg = " Failed to delete. Make sure data child has been deleted or foreign key not connected " ; return redirect ( ) -> route ( 'supplier.index' ) -> with ( 'error' , $ msg ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .