chore: update document approval workflow and bug fixes

This commit is contained in:
2026-05-25 13:05:20 +08:00
parent d573c02893
commit 39a8e1d4cd
910 changed files with 49994 additions and 1010 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Modules\MasterData\Models;
use App\Traits\HasPublicIdentifier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Modules\ProjectManagement\Models\Project;
class MaterialGroup extends Model
{
use HasPublicIdentifier;
protected $fillable = ['name', 'description', 'status'];
public function materials(): BelongsToMany
{
return $this->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');
}
}