/** * Handle the command. * * @param Container $container * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|null */ public function handle(Container $container) { if ($type = $this->item->getEntryType()) { /* @var Builder|EloquentModel $model */ $model = $container->make($type); return $model->find($this->item->getEntryId()); } return null; }
/** * Get the instance as an array. * * @return array */ public function toArray() { return $this->object->toArray(); }