app/Http/Controllers/CommentController.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(CreateCommentRequest $request,Fbook $fbook)
    {
        Comment::create([
          'content'=>$request->content,
          'user_id'=>auth()->user()->id,
          'fbook_id'=>$fbook->id
        ]);
        return redirect(route('bookshow',$fbook->id));
    }
public function store ( CreateCommentRequest $ request , Fbook $ fbook ) { Comment :: create ( [ 'content' => $ request -> content , 'user_id' => auth ( ) -> user ( ) -> id , 'fbook_id' => $ fbook -> id ] ) ; return redirect ( route ( 'bookshow' , $ fbook -> id ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .