User.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. class User extends Authenticatable
  7. {
  8. use Notifiable;
  9. /**
  10. * The attributes that are mass assignable.
  11. *
  12. * @var array
  13. */
  14. protected $fillable = [
  15. 'name', 'email', 'password',
  16. ];
  17. /**
  18. * The attributes that should be hidden for arrays.
  19. *
  20. * @var array
  21. */
  22. protected $hidden = [
  23. 'password', 'remember_token',
  24. ];
  25. /**
  26. * The attributes that should be cast to native types.
  27. *
  28. * @var array
  29. */
  30. protected $casts = [
  31. 'email_verified_at' => 'datetime',
  32. ];
  33. public function restaurants(){
  34. return $this->hasOne('App\Models\Restaurants','user_id','id');
  35. }
  36. public function resto_users(){
  37. return $this->hasOne('App\Models\RestoUsers','user_id','id');
  38. }
  39. public function admin_users(){
  40. return $this->hasOne('App\Models\AdminUsers','user_id','id');
  41. }
  42. }