app/Http/Controllers/CommentaryController.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(Request $request)
    {
        dd(__METHOD__,$request->input(),'Прошло успешно');
        if(!$post = Post::find((int)$request->header('postId')))
            return;
        $commentary = new Commentary();
        $commentary->post()->associate($post);
        $commentary->user()->associate(Auth::user());
        $commentary->text = $request->header('text');
        $commentary->save();
    }
public function store ( Request $ request ) { dd ( __METHOD__ , $ request -> input ( ) , 'Прошло успешно'); }
Store a newly created resource in storage.
Store a newly created resource in storage .
// //        if(!$post = Post::find((int)$request->header('postId'))) //            return; // //        $commentary = new Commentary(); //        $commentary->post()->associate($post); //        $commentary->user()->associate(Auth::user()); //        $commentary->text = $request->header('text'); //        $commentary->save();