Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jahid's avatar
Level 1

relationship method

i am new at laravel 5.2 so hope you guys will help me. i am creating an application named BLOG. in this blog app i have created a relation between post and category method. who ever post a status it will show the category i have assigned manually form database. but i have made a field for create category where users can create category. but when i submit the category it shows

LogicException in Model.php line 2723: Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation

here its not saving the category also didn't redirect to category index.

but the newly made category is already saved in database also into my app. dont know ehat to do.

0 likes
2 replies

Please or to participate in this conversation.