HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/dashboard.orbiwheels.com/app/Models/Document.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Document extends Model
{
    use SoftDeletes;
    protected $fillable = [
        'owner_type',
        'owner_id',
        'doc_type',
        'doc_number',
        'expiry_date',
        'is_verified',
        'file_url',
    ];


    public function owner()
    {
        return $this->morphTo();
    }

    const DRIVER_LICENSE  = 'dl';
    const AADHAAR         = 'aadhaar';
    const AADHAR          = 'aadhar';
    const PAN_CARD        = 'pan';
    const PASSPORT        = 'passport';
    const RC_BOOK         = 'rc';
    const INSURANCE       = 'insurance';
    const PERMIT          = 'permit';
    const GST             = 'gst';
    const POLLUTION       = 'pollution';
    const OTHER           = 'other';

    public static function documentTypes($type = null)
    {
        $types = [
            self::DRIVER_LICENSE => 'Driver License',
            self::AADHAAR        => 'Aadhaar Card',
            self::AADHAR         => 'Aadhaar Card',
            self::PAN_CARD       => 'PAN Card',
            self::PASSPORT       => 'Passport',
            self::RC_BOOK        => 'Registration Certificate',
            self::INSURANCE      => 'Insurance',
            self::PERMIT         => 'Permit',
            self::GST            => 'GST',
            self::POLLUTION      => 'Pollution',
            self::OTHER          => 'Other',
        ];

        if ($type) {
            return $types[$type] ?? 'Unknown';
        }

        return $types;
    }
}