Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. id | name | value | type |
  2. 1 | Test_Array | [somearray] | array |
  3. 2 | Test_Boolean | someboolean | boolean |
  4.  
  5. protected function getCastType($key) {
  6. if ($key == 'value' && !empty($this->type)) {
  7. return $this->type;
  8. } else {
  9. return parent::getCastType($key);
  10. }
  11. }
  12.  
  13. $model == (new Model(['type' => $data['type']))->fill($data)->save();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement