Module 2 — Geographic Data: PSGC tables (regions/provinces/cities/ barangays) with native geometry(polygon|point, 4326) columns; cascading dropdown endpoints; ST_Contains-based GPS resolution; service-area CRUD with barangay attach/detach; SamplePsgcSeeder + psgc:import command. Module 3 — User Management: 5 role-specific profile tables (driver/ helper/scanner/store_partner with verification_status + rejection reason); profile auto-created on register; admin user CRUD with filters/pagination, suspend/activate, profile approve/reject; self-service /me + /me/profile with role-aware validation that blocks self-approval and resets rejected profiles to pending on resubmit. 69 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 lines
935 B
PHP
41 lines
935 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\HasProfileVerification;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class ScannerProfile extends Model
|
|
{
|
|
use HasFactory, HasProfileVerification, SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'shift_preference',
|
|
'date_of_birth',
|
|
'gender',
|
|
'emergency_contact_name',
|
|
'emergency_contact_phone',
|
|
'verification_status',
|
|
'verified_at',
|
|
'verified_by_admin_id',
|
|
'rejection_reason',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'date_of_birth' => 'date',
|
|
'verified_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|