public function replaceReferenceOnParent($link, $parent) { $parent_item = Links::find($parent); $parent_item->update(['content' => str_replace($link->url, '/' . $link->slug, $parent_item->content), 'indexed_link' => 1]); $external_link = ExternalLinks::find($link->id); if ($external_link) { $external_link->update(['processed' => 1]); } }
/** * Create a new job instance. */ public function __construct(LinkWasCreated $event) { $this->event = json_decode(json_encode($event)); $this->link = Links::find($this->event->link->id); $this->readability = $this->event->readability; $this->embeds = new EmbedsRepo(); $this->entities = new EntitiesRepo(); $this->keywords = new KeywordsRepo(); $this->links = new LinksRepo(new ReadabilityRepo(), new SemanticRepo(new AlchemyAPI())); $this->subtypes = new SubtypesRepo(); $this->media = new Media(); $this->external_links = new ExternalLinksRepo(); }