OrderAddress.php
556 Bytes
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class OrderAddress extends Model
{
use HasDateTimeFormatter;
protected $table = 'order_address';
protected $primaryKey = 'order_address_id';
public $timestamps = false;
public function order()
{
return $this->belongsTo(Order::class, 'order_id', 'order_id');
}
public static function getOrderAddress($orderId=0){
return self::where("order_id",$orderId)->get()->toArray();
}
}