Support the ongoing development of Laravel.io →
Input Database Eloquent
Last updated 1 year ago.
0

Anyone?

Last updated 1 year ago.
0

If you change the comment function to skip $post_id does it work?

public function newComment()
{
    $post = Post::find(Input::get('post_id'));

    if ( ! $post) return Redirect::action('BlogController@index');

    $comment = New Comment();
    $comment->user_id = Auth::user()->id;
    $comment->body = Input::get('body');

    $post->comments()->save($comment);

    return Redirect::action('BlogController@index');
}
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

gdroel gdroel Joined 5 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.