belongsToMany(Material::class, 'material_group_items') ->withTimestamps(); } public function projects(): BelongsToMany { return $this->belongsToMany(Project::class, 'project_material_groups') ->withTimestamps(); } public function scopeActive($query) { return $query->where('status', 'active'); } }