Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Model;
  6.  
  7. class Item extends Models
  8. {
  9. protected $fillable = [
  10. 'name',
  11. 'type',
  12. 'expirationDate',
  13. 'amount'
  14.  
  15. ];
  16.  
  17. protected $casts = [
  18. 'name' => 'string',
  19. 'type' => 'string',
  20. 'expirationDate' => 'date',
  21. 'amount' => 'float'
  22. ];
  23.  
  24. public function Items() {
  25. return $this->hasMany('App\Models\Item');
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement