Support the ongoing development of Laravel.io →
posted 9 years ago
Queues
Last updated 2 years ago.
0

Instead of:

$user->post()->save($post);

Try:

$post->push();
0

Hi thank you for your response but it ddnt work still returns the same error. what do you think is causing the error?

0

I think error in route You have use

Route::get('newpost',.....);
Route::post('newpost',....);

Or try

$user->posts()->save($post)
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

lovingLara lovinglara Joined 16 Jan 2015

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.