app/Http/Controllers/Admin/GradesController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Grade  $grade
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Grade $grade)
    {
        if (Gate::denies('manage-system')) {
            return redirect(route('admin.grades.index'));
        }
        $grade->subjects()->detach();
        $grade->delete();
        return redirect()->route('admin.grades.index');
    }
public function destroy ( Grade $ grade ) { if ( Gate :: denies ( 'manage-system' ) ) { return redirect ( route ( 'admin.grades.index' ) ) ; } $ grade -> subjects ( ) -> detach ( ) ; $ grade -> delete ( ) ; return redirect ( ) -> route ( 'admin.grades.index' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .