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.
29 lines
620 B
29 lines
620 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Vehicle extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $guarded = ['id'];
|
|
protected $casts = [
|
|
'id' => 'integer',
|
|
'status' => 'integer',
|
|
'extra_charges' => 'float',
|
|
'starting_coverage_area' => 'float',
|
|
'maximum_coverage_area' => 'float',
|
|
];
|
|
|
|
public function delivery_man()
|
|
{
|
|
return $this->hasOne(DeliveryMan::class);
|
|
}
|
|
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('status', 1);
|
|
}
|
|
}
|
|
|