app/Http/Controllers/Admin/EssayAssignmentsController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Essay_Assignment  $essay_Assignment
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(EssayAssignment $essayassignment)
    {
        $essay_assignments = EssayAssignment::has('students')->has('tutors')->get();
        $essay_statuses = EssayStatus::all();
        $data = [
            'essay_assignments' => $essay_assignments,
            'statuses'          => $essay_statuses,
            'old'               => [
            'a_id'              => $essayassignment->assignment_num,
            's_name'            => "",
            't_name'            => "",
            'topic'             => $essayassignment->topic,
            'status'            => $essayassignment->status_id,
            'paid_to_tutor'     => $essayassignment->paid,
            'price_owed'        => $essayassignment->owed,
            'a_date_from'       => $essayassignment->date_assigned,
            'a_date_to'         => $essayassignment->date_assigned,
            'c_date_from'       => $essayassignment->date_completed,
            'c_date_to'         => $essayassignment->date_completed,
            ],
        ];
        $essayassignment->delete();
        return redirect()->route('admin.essayassignments.index')->with('data', $data);
    }
public function destroy ( EssayAssignment $ essayassignment ) { $ essay_assignments = EssayAssignment :: has ( 'students' ) -> has ( 'tutors' ) -> get ( ) ; $ essay_statuses = EssayStatus :: all ( ) ; $ data = [ 'essay_assignments' => $ essay_assignments , 'statuses' => $ essay_statuses , 'old' => [ 'a_id' => $ essayassignment -> assignment_num , 's_name' => " " , 't_name' => " " , 'topic' => $ essayassignment -> topic , 'status' => $ essayassignment -> status_id , 'paid_to_tutor' => $ essayassignment -> paid , 'price_owed' => $ essayassignment -> owed , 'a_date_from' => $ essayassignment -> date_assigned , 'a_date_to' => $ essayassignment -> date_assigned , 'c_date_from' => $ essayassignment -> date_completed , 'c_date_to' => $ essayassignment -> date_completed , ] , ] ; $ essayassignment -> delete ( ) ; return redirect ( ) -> route ( 'admin.essayassignments.index' ) -> with ( 'data' , $ data ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .