/**
  * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
  */
 public function toArray()
 {
     $value = $this->getModelValue();
     $originalValue = $value;
     if (!is_null($value)) {
         if (!$value instanceof Carbon) {
             $value = Carbon::parse($value);
         }
         $value = $value->format($this->getFormat());
     }
     $this->setAttribute('data-order', $originalValue);
     return parent::toArray() + ['value' => $value, 'originalValue' => $originalValue, 'append' => $this->getAppends()];
 }
Exemplo n.º 2
0
 public function toArray()
 {
     return parent::toArray() + ['icon' => $this->icon(), 'style' => $this->style(), 'value' => $this->value(), 'target' => $this->target(), 'url' => $this->url()];
 }