Service_worker.php 414 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Service_worker extends Model
  5. {
  6. public function orders()
  7. {
  8. return $this->hasMany(Order::class);
  9. }
  10. public function services()
  11. {
  12. return $this->belongsTo(Service::class, 'service_id', 'id');
  13. }
  14. public function workers()
  15. {
  16. return $this->belongsTo(Worker::class, 'worker_id', 'id');
  17. }
  18. }