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