<?php

namespace App\Models;

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

class AppOrder extends Model
{
    use HasFactory;

    protected $fillable = [
        'CustomerNo',
        'CreatedBy',
        'DeliveryDate',
        'TotalAmount',
        'ProcessStatus'
    ];

    // protected $appends = ['ShowPrice'];



    public function orderItems()
    {
        return $this->hasMany(AppOrderItem::class, 'app_order_id', 'id');
    }




    // public function getShowPricesAttribute()
    // {
    //     if (auth()->check()) {
    //         return (bool) auth()->user()->show_prices;
    //     }
    //     return false;
    // }


}
