BaseDistrict.php 533 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. class BaseDistrict extends Model
  5. {
  6. protected $table = 'base_district';
  7. protected $guarded = [];
  8. public function province()
  9. {
  10. return $this->belongsTo(BaseDistrict::class, 'pid', 'id');
  11. }
  12. public function city()
  13. {
  14. return $this->belongsTo(BaseDistrict::class, 'pid', 'id');
  15. }
  16. // public function communities()
  17. // {
  18. // return $this->hasMany(Communities::class,'area_id','id');
  19. // }
  20. }