City.php 553 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Shop\Cities;
  3. use App\Shop\Provinces\Province;
  4. use Illuminate\Database\Eloquent\Model;
  5. class City extends Model
  6. {
  7. /**
  8. * The attributes that are mass assignable.
  9. *
  10. * @var array
  11. */
  12. protected $fillable = [
  13. 'name',
  14. 'province_id'
  15. ];
  16. public $timestamps = false;
  17. /**
  18. * The attributes that should be hidden for arrays.
  19. *
  20. * @var array
  21. */
  22. protected $hidden = [];
  23. public function province()
  24. {
  25. return $this->belongsTo(Province::class);
  26. }
  27. }