Initial Ladill Frontdesk release with deploy pipeline.
Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\BelongsToOwner;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Visitor extends Model
|
||||
{
|
||||
use BelongsToOwner, SoftDeletes;
|
||||
|
||||
protected $table = 'frontdesk_visitors';
|
||||
|
||||
public const WATCHLIST_ALLOWED = 'allowed';
|
||||
|
||||
public const WATCHLIST_REQUIRES_APPROVAL = 'requires_approval';
|
||||
|
||||
public const WATCHLIST_BLACKLISTED = 'blacklisted';
|
||||
|
||||
protected $fillable = [
|
||||
'owner_ref', 'organization_id', 'full_name', 'company', 'phone', 'email',
|
||||
'photo_path', 'id_document_path', 'watchlist_status', 'notes',
|
||||
'visit_count', 'is_frequent',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['is_frequent' => 'boolean'];
|
||||
}
|
||||
|
||||
public function organization(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Organization::class, 'organization_id');
|
||||
}
|
||||
|
||||
public function visits(): HasMany
|
||||
{
|
||||
return $this->hasMany(Visit::class, 'visitor_id');
|
||||
}
|
||||
|
||||
public function isBlacklisted(): bool
|
||||
{
|
||||
return $this->watchlist_status === self::WATCHLIST_BLACKLISTED;
|
||||
}
|
||||
|
||||
public function requiresApproval(): bool
|
||||
{
|
||||
return $this->watchlist_status === self::WATCHLIST_REQUIRES_APPROVAL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user