1: <?php
2:
3: namespace App;
4:
5: use Illuminate\Database\Eloquent\Model;
6:
7: class Driver extends Model
8: {
9: 10: 11: 12: 13:
14: protected $table = 'driver';
15:
16:
17: 18: 19: 20: 21:
22: protected $fillable = [
23: 'user_id',
24: 'drivers_exp',
25: 'global_information',
26: 'star_rating',
27: 'taxi_id'
28: ];
29: protected $hidden = ['user_id'];
30:
31: public function user(){
32: return $this->belongsTo('App\User');
33: }
34: public function taxi(){
35: return $this->belongsTo('App\Taxi', 'id', 'driver_id');
36: }
37: public function comment(){
38: return $this->hasMany('App\Comment');
39: }
40:
41: }
42: