I have stable project with Laravel 5.3.
Today decided to upgrade Laravel to 5.4 and then to 5.5. I am following to official upgrade guide.
After 5.4 upgrade everything seems to work.. except one thing. One of my multiple belongsToMany relationships produces now wrong sql.
I have model App\Situation with relationship:
public function feedbacks()
{
return $this->belongsToMany('App\Feedback');
}
And App\Feedback model with:
public function situations()
{
return $this->belongsToMany('App\Situation');
}
Of course I have tables feedbacks, situations and feedback_situation. Before upgrade this code was fine:
dd($situation->feedbacks);
But now it produces exception:
Base table or view not found: 1146 Table 'example.feedback' doesn't exist (SQL: select
feedback.*,feedback_situation.situation_idaspivot_situation_id,feedback_situation.feedback_idaspivot_feedback_idfromfeedbackinner joinfeedback_situationonfeedback.id=feedback_situation.feedback_idwherefeedback_situation.situation_id= 383)
It's very weird because other relationships works, and this one worked on 5.3.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire