'integer', 'order_id' => 'integer', 'user_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime' ]; public function customer() { return $this->belongsTo(User::class,'user_id'); } public function order() { return $this->belongsTo(Order::class); } public function delivery_man() { return $this->belongsTo(DeliveryMan::class,'delivery_man_id'); } public function scopeActive($query) { return $query->where('status',1); } }