refactor(branch): clean up formatting and structure in Branch model #3

Merged
sholahuddin merged 1 commits from shola into master 2025-12-11 17:24:34 +07:00
Showing only changes of commit b8cf5e550f - Show all commits

View File

@@ -1,9 +1,9 @@
<?php
namespace Modules\Basicdata\Models;
namespace Modules\Basicdata\Models;
class Branch extends Base
{
class Branch extends Base
{
protected $table = 'branches';
protected $fillable = [
'code',
@@ -40,4 +40,10 @@
{
return $this->hasMany(Branch::class, 'parent_id');
}
public function users()
{
return $this->belongsToMany(Modules\Usermanagement\Models\User::class, 'user_branches', 'branch_id', 'user_id');
}
}