File "ContactQuery.php"

Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Models/ContactQuery.php
File size: 925 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ContactQuery extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'email',
        'phone',
        'subject',
        'message',
        'location_id',
        'department',
        'is_read',
        'create_at',
        'updated_at',
    ];

    protected $dates = [
        'created_at',
        'updated_at',
    ];

    protected $casts = [
        'created_at'  => 'date:m-d-Y',
        'updated_at'  => 'date:m-d-Y',
    ];

    public const DEPARTMENTS = [
        'Sales Team',
        'Order Help Desk',
        'Graphics and Artwork',
        'Accounting',
    ];

    public function location(): BelongsTo
    {
        return $this->belongsTo(StoreLocation::class, 'location_id');
    }
}