app/Http/Controllers/Admin/TutorAssignmentsController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Assignment  $assignment
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Assignment $tutorassignment)
    {
        if (Gate::denies('delete-users')) {
            $assignments = Assignment::all();
            $data = [
                'assignments' => $assignments,
            ];
            return redirect(route('admin.tutorassignments.index'))->with('data', $data);
        }
        $tutorassignment->delete();
        $assignments = Assignment::all();
        $data = [
            'assignments' => $assignments,
        ];
        return redirect()->route('admin.tutorassignments.index')->with('data', $data);
    }
public function destroy ( Assignment $ tutorassignment ) { if ( Gate :: denies ( 'delete-users' ) ) { $ assignments = Assignment :: all ( ) ; $ data = [ 'assignments' => $ assignments , ] ; return redirect ( route ( 'admin.tutorassignments.index' ) ) -> with ( 'data' , $ data ) ; } $ tutorassignment -> delete ( ) ; $ assignments = Assignment :: all ( ) ; $ data = [ 'assignments' => $ assignments , ] ; return redirect ( ) -> route ( 'admin.tutorassignments.index' ) -> with ( 'data' , $ data ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .