Country.php 784 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Shop\Countries;
  3. use App\Shop\Provinces\Province;
  4. use App\Shop\States\State;
  5. use Illuminate\Database\Eloquent\Model;
  6. class Country extends Model
  7. {
  8. /**
  9. * The attributes that are mass assignable.
  10. *
  11. * @var array
  12. */
  13. protected $fillable = [
  14. 'name',
  15. 'iso',
  16. 'iso3',
  17. 'numcode',
  18. 'phonecode',
  19. 'status'
  20. ];
  21. /**
  22. * The attributes that should be hidden for arrays.
  23. *
  24. * @var array
  25. */
  26. protected $hidden = [];
  27. public function provinces()
  28. {
  29. return $this->hasMany(Province::class);
  30. }
  31. /**
  32. * @return \Illuminate\Database\Eloquent\Relations\HasMany
  33. */
  34. public function states()
  35. {
  36. return $this->hasMany(State::class);
  37. }
  38. }