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.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App;
  3. use Illuminate\Notifications\Notifiable;
  4. use Jenssegers\Mongodb\Eloquent\SoftDeletes;
  5. use Jenssegers\Mongodb\Auth\User as Authenticatable;
  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 $fillable = ['_id', 'email', 'password', 'roles_access', 'last_login_at', 'last_login_ip'];
  15. protected $hidden = [
  16. 'password', 'remember_token',
  17. ];
  18. public function staffdetail() {
  19. return $this->hasOne('App\Model\StaffDetail','_id','_id')->withTrashed();
  20. }
  21. public function company() {
  22. return $this->belongsTo('App\Model\Company','company_id','_id');
  23. }
  24. public function form() {
  25. return $this->hasMany('App\Model\Form','dealer_id','_id');
  26. }
  27. public function workorder() {
  28. return $this->hasMany('App\Model\WorkOrder','installer_id','_id')->withTrashed();
  29. }
  30. }