create many to many relation between rahdaran and road item

This commit is contained in:
2024-12-19 08:15:40 +00:00
parent 549bd8ebe1
commit 767830cf47
7 changed files with 55 additions and 47 deletions

View File

@@ -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');
}
}