app/Http/Controllers/Instructor/UserInstructorQuestionController.php
/**
     * Store User Instructor Questions
     * 
     * @return Illuminate\Http\Request
     */
Store User Instructor Questions

@return Illuminate\Http\Request
Store User Instructor Questions @return Illuminate \ Http \ Request
public function store(Request $request)
    {
        $this->validate($request, [
            'teaching_skills' => 'required',
            'video_skills' => 'required',
            'audience_number' => 'required'
        ]);
        $user = $request->user();
        $uiQuestion = new UserInstructorQuestion();
        $request->user()
            ->userInstructorQuestion()->save($uiQuestion);
        $user->role_id = 3;
        $user->save();
        return response()
            ->json([
                'saved' => true,
                'id' => $uiQuestion->id,
                'message' => 'Congratulations! You can now post your courses.',
                'role_id' => $user->role_id
            ]);
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'teaching_skills' => 'required' , 'video_skills' => 'required' , 'audience_number' => 'required' ] ) ; $ user = $ request -> user ( ) ; $ uiQuestion = new UserInstructorQuestion ( ) ; $ request -> user ( ) -> userInstructorQuestion ( ) -> save ( $ uiQuestion ) ; $ user -> role_id = 3 ; $ user -> save ( ) ; return response ( ) -> json ( [ 'saved' => true , 'id' => $ uiQuestion -> id , 'message' => 'Congratulations! You can now post your courses.' , 'role_id' => $ user -> role_id ] ) ; }
Store User Instructor Questions
Store User Instructor Questions