create many to many relation between rahdaran and road item
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Rahdaran extends Model
|
||||
{
|
||||
@@ -11,4 +12,10 @@ class Rahdaran extends Model
|
||||
|
||||
protected $guarded = [];
|
||||
protected $table = 'rahdaran';
|
||||
protected $hidden = ['pivot'];
|
||||
|
||||
public function roadItemsProject(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(RoadItemsProject::class,'rahdaran_road_items_project');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user