belongsTo('App\Models\Province'); } public function users() { return $this->hasMany('App\Models\User'); } /** * Get all of the projects for the city. */ public function roadConstructionProjects() { return $this->hasManyThrough('App\Models\RoadConstructionProject', 'App\Models\User'); } /** * Get all of the projects for the city. */ public function roadItemsProjects() { return $this->hasManyThrough('App\Models\RoadItemsProject', 'App\Models\User'); } /** * Get all of the projects for the city. */ public function roadPatrolProjects() { return $this->hasManyThrough('App\Models\RoadPatrolProject', 'App\Models\User'); } /** * Get all of the projects for the province. */ public function roadMaintenanceProjects() { return $this->hasMany('App\Models\RoadMaintenanceProject'); } /** * Get all of the projects for the province. */ public function roadConstructionRural() { return $this->hasMany('App\Models\RoadConstructionRural'); } public function edarateShahri() { return $this->belongsToMany('App\Models\EdarateShahri', 'edarate_shahri_be_city')->withPivot('is_primary','id'); } }