/** * @param array $attributes * * @return $this */ public function updateWithRelations(array $attributes) { parent::updateWithRelations($attributes); $this->name = $attributes['name']; return $this; }
public function registerMediaConversions() { parent::registerMediaConversions(); $this->addMediaConversion('thumb')->setWidth(368)->setHeight(232)->performOnCollections('images'); }
/** * @param array $attributes * * @return $this */ public function updateWithRelations(array $attributes) { parent::updateWithRelations($attributes); $this->publish_date = Carbon::createFromFormat('d/m/Y', $attributes['publish_date']); return $this; }