inital commit
This commit is contained in:
30
app/Models/EdarateShahri.php
Normal file
30
app/Models/EdarateShahri.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EdarateShahri extends Model
|
||||
{
|
||||
protected $table = 'edarate_shahri';
|
||||
|
||||
public function cities()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\City', 'edarate_shahri_be_city')->withPivot('is_primary','id');
|
||||
}
|
||||
|
||||
public function roadObserved()
|
||||
{
|
||||
return $this->hasMany(RoadObserved::class);
|
||||
}
|
||||
|
||||
public function roadItemsProjects()
|
||||
{
|
||||
return $this->morphMany(RoadItemsProject::class, 'edarat');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Province');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user