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.

Staff.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\LatestModel;
  3. use Illuminate\Notifications\Notifiable;
  4. use Jenssegers\Mongodb\Auth\User as Authenticatable;
  5. use Jenssegers\Mongodb\Eloquent\SoftDeletes;
  6. class Staff extends Authenticatable
  7. {
  8. //
  9. use SoftDeletes;
  10. use Notifiable;
  11. protected $connection = 'mongodb';
  12. protected $collection = 'staff';
  13. protected $guarded = ['_id'];
  14. protected $hidden = [
  15. 'password', 'remember_token',
  16. ];
  17. public function staffdetail() {
  18. return $this->hasOne('App\LatestModel\StaffDetail','_id','_id')->withTrashed();
  19. }
  20. public function company() {
  21. return $this->belongsTo('App\LatestModel\Module\Company','company_id','_id');
  22. }
  23. public function form() {
  24. return $this->hasMany('App\LatestModel\Module\Form','dealer_id','_id');
  25. }
  26. public function workorder() {
  27. return $this->hasMany('App\LatestModel\Module\WorkOrder','installer_id','_id')->withTrashed();
  28. }
  29. public function tracklocation(){
  30. return $this->hasMany('App\LatestModel\Module\TrackLocation');
  31. }
  32. public function currentlocation(){
  33. return $this->hasOne('App\LatestModel\Module\CurrentLocation');
  34. }
  35. public function notification()
  36. {
  37. return $this->hasMany('App\LatestModel\Module\Notification');
  38. }
  39. }