28 lines
985 B
PHP
28 lines
985 B
PHP
<?php
|
|
namespace App\Models;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class WaitingRide extends Model {
|
|
protected $connection = 'primary';
|
|
protected $table = 'waitingRides';
|
|
protected $primaryKey = 'id';
|
|
protected $keyType = 'string';
|
|
public $incrementing = false;
|
|
public $timestamps = false;
|
|
protected $fillable = [
|
|
'id', 'start_location', 'start_lat', 'start_lng', 'end_location',
|
|
'end_lat', 'end_lng', 'date', 'time', 'price', 'passenger_id',
|
|
'status', 'carType', 'passengerRate', 'created_at',
|
|
'price_for_passenger', 'distance', 'duration', 'payment_method',
|
|
'passenger_wallet',
|
|
];
|
|
protected $casts = [
|
|
'start_lat' => 'decimal:7', 'start_lng' => 'decimal:7',
|
|
'end_lat' => 'decimal:7', 'end_lng' => 'decimal:7',
|
|
'price' => 'decimal:2', 'price_for_passenger' => 'decimal:2',
|
|
];
|
|
public function scopeWaiting($query) {
|
|
return $query->where('status', 'waiting');
|
|
}
|
|
}
|