app/Http/Controllers/Admin/TutorAssignmentsController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        if (Gate::denies('manage-tutors')) {
            return redirect(route('admin.tutorassignments.index'));
        }
        $tutors = Role::find(config('global.TUTOR_ROLE_ID'))->users()->get();
        $students = Role::find(config('global.STUDENT_ROLE_ID'))->users()->get();
        $rates = Rate::all();
        $subjects = Subject::all();
        $data = [
            'tutors'        => $tutors,
            'students'      => $students,
            'subjects'      => $subjects,
            'rates'         => $rates,
        ];
        return view('admin.tutorassignments.create')->with('data', $data);
    }
public function create ( ) { if ( Gate :: denies ( 'manage-tutors' ) ) { return redirect ( route ( 'admin.tutorassignments.index' ) ) ; } $ tutors = Role :: find ( config ( 'global.TUTOR_ROLE_ID' ) ) -> users ( ) -> get ( ) ; $ students = Role :: find ( config ( 'global.STUDENT_ROLE_ID' ) ) -> users ( ) -> get ( ) ; $ rates = Rate :: all ( ) ; $ subjects = Subject :: all ( ) ; $ data = [ 'tutors' => $ tutors , 'students' => $ students , 'subjects' => $ subjects , 'rates' => $ rates , ] ; return view ( 'admin.tutorassignments.create' ) -> with ( 'data' , $ data ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .