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.

Form.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\LatestModel\Module;
  3. use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
  4. use Jenssegers\Mongodb\Eloquent\SoftDeletes;
  5. class Form extends Eloquent {
  6. //
  7. use SoftDeletes;
  8. protected $connection = 'mongodb';
  9. protected $collection = 'form_submitted';
  10. // protected $guarded = ['_id'];
  11. protected $fillable = ['_id','type_service','type_application','status_payment','status_email','remark_form','created_at'];
  12. public function staff() {
  13. return $this->belongsTo('App\LatestModel\Staff','_id','dealer_id');
  14. }
  15. public function subscriber() {
  16. return $this->hasOne('App\LatestModel\Module\Subscriber','_id','_id');
  17. }
  18. public function subscribetrashed() {
  19. return $this->hasOne('App\LatestModel\Module\Subscriber','_id','_id')->onlyTrashed();
  20. }
  21. public function packagedetail(){
  22. return $this->hasOne('App\LatestModel\Module\PackageDetail','_id','_id');
  23. }
  24. public function packagedetailtrashed(){
  25. return $this->hasOne('App\LatestModel\Module\PackageDetail','_id','_id')->onlyTrashed();
  26. }
  27. public function workorder(){
  28. return $this->hasOne('App\LatestModel\Module\WorkOrder','_id','_id');
  29. }
  30. public function workordertrashed(){
  31. return $this->hasOne('App\LatestModel\Module\WorkOrder','_id','_id')->onlyTrashed();
  32. }
  33. public function formstatus(){
  34. return $this->hasMany('App\LatestModel\Module\FormStatus','form_id','_id');
  35. }
  36. public function company(){
  37. return $this->belongsTo('App\LatestModel\Module\Company','company_id','_id')->withTrashed();
  38. }
  39. }