1: <?php
2:
3: namespace App;
4:
5: use Illuminate\Database\Eloquent\Model;
6:
7: class Taxi extends Model
8: {
9: 10: 11: 12: 13:
14: protected $table = 'taxi';
15:
16:
17: 18: 19: 20: 21:
22: protected $fillable = [
23: 'driver_id',
24: 'last_seen',
25: 'last_latitude',
26: 'last_longtitude',
27: 'license_plate',
28: 'car_brand',
29: 'car_color',
30: 'car_model',
31: 'in_shift'
32: ];
33:
34: public function tablet(){
35: return $this->hasMany('App\Tablet');
36: }
37: public function driver(){
38: return $this->hasOne('App\Driver' , 'id', 'driver_id');
39: }
40: public function emergency(){
41: return $this->hasMany('App\Emergency');
42: }
43: public function route(){
44: return $this->hasMany('App\Route');
45: }
46:
47:
48:
49: }
50: