示例#1
0
 /**
  * @param array $attributes
  *
  * @return $this
  */
 public function updateWithRelations(array $attributes)
 {
     parent::updateWithRelations($attributes);
     $this->name = $attributes['name'];
     return $this;
 }
示例#2
0
 public function registerMediaConversions()
 {
     parent::registerMediaConversions();
     $this->addMediaConversion('thumb')->setWidth(368)->setHeight(232)->performOnCollections('images');
 }
示例#3
0
 /**
  * @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;
 }