SupplyOrder.php 975 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Models;
  3. # use Illuminate\Database\Eloquent\Model;
  4. class SupplyOrder extends Model
  5. {
  6. protected $table = 'supply_order';
  7. public function client()
  8. {
  9. return $this->hasOne(Client::class, 'id', 'client_id');
  10. }
  11. public function product()
  12. {
  13. return $this->hasOne(Product::class, 'id', 'product_id');
  14. }
  15. public function shipment()
  16. {
  17. return $this->hasOne(Shipment::class, 'id', 'shipment_id');
  18. }
  19. public function signedPro() {
  20. return $this->hasOne(Pro::class, 'id', 'signed_by_pro_id');
  21. }
  22. public function waiverPro() {
  23. return $this->hasOne(Pro::class, 'id', 'client_signature_waived_by_pro_id');
  24. }
  25. public function clearedForShipmentPro() {
  26. return $this->hasOne(Pro::class, 'id', 'cleared_for_shipment_by_pro_id');
  27. }
  28. public function createdSession()
  29. {
  30. return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
  31. }
  32. }