app/Http/Controllers/QuestionController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(AskQuestionRequest $request)
    {
       $request->user()->questions()
               ->create($request->only('title','body'));
       return redirect()->route('questions.index')
               ->with('success','Your Question Submitted');
    }
public function store ( AskQuestionRequest $ request ) { $ request -> user ( ) -> questions ( ) -> create ( $ request -> only ( 'title' , 'body' ) ) ; return redirect ( ) -> route ( 'questions.index' ) -> with ( 'success' , 'Your Question Submitted' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .