我正在努力弄清楚如何使用Laravel雄辩5.3获得一个类别的所有帖子。id | title | text
term_id | post_id
id | nameclassTerm extends Model public function posts() return $this->belongsToMany('Appt
如何从两个使用枢轴表连接的表中获取数据?例如,在我的示例中,用户表使用枢轴表(penulis表)连接到日志表。现在我想得到属于特定用户的日志数据。以下是我的移民:public function up() Schema::create('users', function (Blueprint $table)
在event_join中,我只有参加活动的客户身份。public function customers() return $this->belongsToMany(Events::class,EventsJoin::class);我的客户模型有这个public function events() return $this->belongsToMany(Customer::class,EventsJoin::class);我的EventsJoin有这个
$ev
我试着用Laravel雄辩来做一个复杂的查询。我知道如何使用原始SQL查询来完成它,但是我不知道如何使用雄辩的方法来完成它。student_student_movements表具有多到多的关系: public function studentMovements(): BelongsToMany Student::class,