Пример #1
0
 public function syncAuthors($authors)
 {
     Author::addNeededAuthors($authors);
     $authors = explode(',', $authors);
     if (count($authors)) {
         $authors = Author::whereIn('name', $authors)->lists('id')->all();
         $this->authors()->sync($authors);
         return;
     }
     $this->author()->detach();
 }
 public function store(AuthorRequest $request)
 {
     $authors = $request->authors;
     Author::addNeededAuthors($authors);
     return $request;
 }