You've already forked Atomcms-edit
574b5d6e17
feat: add 24 model factories for Help, Shop, Community, Game, User domains - Translate mixed Dutch/English strings in README.md and AlertSettings.php - Add HasFactory trait to 23 models - Create factories for Help (6), Shop (4), Community (5), Game (2), User (7)
57 lines
1.5 KiB
PHP
Executable File
57 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models\Community\Staff;
|
|
|
|
use App\Models\Community\Teams\WebsiteTeam;
|
|
use App\Models\Game\Permission;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebsiteStaffApplications where($column, $operator = null, $value = null)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|WebsiteStaffApplications create($attributes = [])
|
|
*/
|
|
class WebsiteStaffApplications extends Model
|
|
{
|
|
use HasFactory;
|
|
#[\Override]
|
|
protected $table = 'website_staff_applications';
|
|
|
|
#[\Override]
|
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'rank_id', 'status'];
|
|
|
|
/** @var array<string, string> */
|
|
#[\Override]
|
|
protected $casts = [
|
|
'approved_at' => 'datetime',
|
|
'rejected_at' => 'datetime',
|
|
];
|
|
|
|
public function approver(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'approved_by');
|
|
}
|
|
|
|
public function rejector(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'rejected_by');
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function rank(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Permission::class, 'rank_id');
|
|
}
|
|
|
|
public function team(): BelongsTo
|
|
{
|
|
return $this->belongsTo(WebsiteTeam::class, 'team_id');
|
|
}
|
|
}
|