You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
770 B
39 lines
770 B
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use App\Models\User;
|
||
|
use Illuminate\Support\Facades\DB;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class DMReview extends Model
|
||
|
{
|
||
|
protected $casts = [
|
||
|
'delivery_man_id' => '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);
|
||
|
}
|
||
|
}
|