Add membership fee system with disability discount and fix document permissions
Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,6 @@ class User extends Authenticatable
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'is_admin',
|
||||
'profile_photo_path',
|
||||
'password',
|
||||
];
|
||||
@@ -46,7 +45,6 @@ class User extends Authenticatable
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'is_admin' => 'boolean',
|
||||
];
|
||||
|
||||
public function member(): HasOne
|
||||
@@ -54,6 +52,15 @@ class User extends Authenticatable
|
||||
return $this->hasOne(Member::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 檢查使用者是否為管理員
|
||||
* 使用 Spatie Permission 的 admin 角色取代舊版 is_admin 欄位
|
||||
*/
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->hasRole('admin');
|
||||
}
|
||||
|
||||
public function profilePhotoUrl(): ?string
|
||||
{
|
||||
if (! $this->profile_photo_path) {
|
||||
|
||||
Reference in New Issue
Block a user