Ejemplo n.º 1
0
 public function afterCreate()
 {
     $newsLink = '/news/' . $this->category . '/item/' . $this->slug;
     $links = Link::where('link', $newsLink)->get();
     foreach ($links as $link) {
         $link->photo = isset($this->photos[0]) ? $this->photos[0] : null;
         $link->save();
     }
 }
Ejemplo n.º 2
0
 public function afterCreate()
 {
     $articleLink = '/articles/' . $this->slug;
     $links = Link::where('link', $articleLink)->get();
     foreach ($links as $link) {
         $link->photo = $this->photo;
         $link->save();
     }
 }