app/Http/Controllers/DiscussionController.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(CreateDiscussionRequest $request,Fbook $fbook)
    {
     Discussion::create([
       'title'=>$request->title,
       'content'=>$request->content,
       'fbook_id'=>$fbook->id
     ]);
     return redirect(route('discussions.show',[$fbook->id,$fbook->discussion->id]));
    }
public function store ( CreateDiscussionRequest $ request , Fbook $ fbook ) { Discussion :: create ( [ 'title' => $ request -> title , 'content' => $ request -> content , 'fbook_id' => $ fbook -> id ] ) ; return redirect ( route ( 'discussions.show' , [ $ fbook -> id , $ fbook -> discussion -> id ] ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .