From 4dccbc5fb41100108f8103902342d087186de70f Mon Sep 17 00:00:00 2001 From: Thombrix Date: Sun, 26 Nov 2023 00:01:56 +0100 Subject: [PATCH] Added pivot table infos in the belongsToMany call --- backend-laravel/app/Models/Ville.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-laravel/app/Models/Ville.php b/backend-laravel/app/Models/Ville.php index d3668ef..5e84ebf 100644 --- a/backend-laravel/app/Models/Ville.php +++ b/backend-laravel/app/Models/Ville.php @@ -56,6 +56,6 @@ public function canton() public function langues() { - return $this->belongsToMany(Langue::class); + return $this->belongsToMany(Langue::class, 'langues_villes', 'ville_id', 'langue_id'); } }