app/Http/Controllers/Admin/AdminmenuController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Adminmenu  $adminmenu
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        try { 
            $adminmenu = Adminmenu::find($id);
            $adminmenu->delete();
            return redirect()->action(
                'Admin\AdminmenuController@index' 
            )->with('success', 'Admin menu has been deleted.');
        } catch(\Illuminate\Database\QueryException $ex){ 
            return redirect()->action(
                'Admin\AdminmenuController@index' 
            )->with('failed', 'Unable to delete, this navigation menu has children/sub menu record(s).');
        }
    }
public function destroy ( $ id ) { try { $ adminmenu = Adminmenu :: find ( $ id ) ; $ adminmenu -> delete ( ) ; return redirect ( ) -> action ( 'Admin\AdminmenuController@index' ) -> with ( 'success' , 'Admin menu has been deleted.' ) ; } catch ( \ Illuminate \ Database \ QueryException $ ex ) { return redirect ( ) -> action ( 'Admin\AdminmenuController@index' ) -> with ( 'failed' , 'Unable to delete, this navigation menu has children/sub menu record(s).' ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .
//$ex->getMessage()