I am working on website where user should enter the category of food along with other infos
There are two tables category and menu, I made one to many relationship:
Now I am trying to store the informatin that I got from user into these tables, and I don't really know how to do that? Below I am trying to that. Could you please help me out with that?
Use like this
$menu = new Menu($menu);
$menu->category()->associate("Your_Category_ID");
$menu->save();