Working proposal apply code, fixed schema (need reset - artisan migrate:fresh)
This commit is contained in:
+20
-11
@@ -154,18 +154,27 @@ class Column implements JsonSerializable, Arrayable
|
||||
/**
|
||||
* @return array with keys {name, title, type}
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray($decorate=true)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'title' => $this->title,
|
||||
'type' => $this->type,
|
||||
'_new' => $this->isNew,
|
||||
'_remove' => $this->toRemove,
|
||||
'_changed' => $this->modified_attribs,
|
||||
'_orig' => $this->orig_attribs,
|
||||
];
|
||||
if ($decorate) {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'title' => $this->title,
|
||||
'type' => $this->type,
|
||||
'_new' => $this->isNew,
|
||||
'_remove' => $this->toRemove,
|
||||
'_changed' => $this->modified_attribs,
|
||||
'_orig' => $this->orig_attribs,
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'title' => $this->title,
|
||||
'type' => $this->type,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user