Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. $coordinates = [
  2. 'x' => 100,
  3. 'y' => 60,
  4. 'h' => 250,
  5. 'w' => 250,
  6. ];
  7.  
  8. $field = StreamField::find(4);
  9. $field->coordinates = $coordinates;
  10. $field->save();
  11.  
  12. protected $casts = [
  13. 'coordinates' => 'array'
  14. ];
  15.  
  16. $field = StreamField::find(4);
  17. return $field->coordinates['x'];
  18.  
  19. $table->json('coordinates')->nullable();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement