app/Http/Controllers/Admin/AssignmentsController.php
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Assignment  $assignment
     * @return \Illuminate\Http\Response
     */
Show the form for editing the specified resource.
Show the form for editing the specified resource .
public function edit(Assignment $assignment)
    {
        if (Gate::denies('manage-students')) {
            return redirect(route('admin.assignments.index'));
        }
        $data = [
            'assignment'    => $assignment,
            'tutors'        => Role::find(config('global.TUTOR_ROLE_ID'))->users()->get(),
            'students'      => Role::find(config('global.STUDENT_ROLE_ID'))->users()->get(),
            'subjects'      => Subject::all()
        ];
        return view('admin.assignments.edit')->with('data', $data);
    }
public function edit ( Assignment $ assignment ) { if ( Gate :: denies ( 'manage-students' ) ) { return redirect ( route ( 'admin.assignments.index' ) ) ; } $ data = [ 'assignment' => $ assignment , 'tutors' => Role :: find ( config ( 'global.TUTOR_ROLE_ID' ) ) -> users ( ) -> get ( ) , 'students' => Role :: find ( config ( 'global.STUDENT_ROLE_ID' ) ) -> users ( ) -> get ( ) , 'subjects' => Subject :: all ( ) ] ; return view ( 'admin.assignments.edit' ) -> with ( 'data' , $ data ) ; }
Show the form for editing the specified resource.
Show the form for editing the specified resource .
//dd($assignment->id);