I have two tables stories and featured Story so I want to add the few story ids to featured table in a single request. How to do that?
here is my code to add the single id to featured story table.
public function saveFeatured($id)
{
# code...
$story = $this->getById($id);
$storyId = $story->id;
$featured = new FeaturedStory();
$featured->story_id = $storyId;
$featured->save();
return "Added to featured StoryList";
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2PmT0OB
via IFTTT
Aucun commentaire:
Enregistrer un commentaire