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.

25 lines
555 B

  1. <?php
  2. namespace App;
  3. use App\HiLib\Models\RemoteModel;
  4. class Task extends RemoteModel
  5. {
  6. public string $host;
  7. public ?string $path;
  8. public function __construct(array $attributes = [])
  9. {
  10. parent::__construct($attributes);
  11. $this->host = 'hi-task-app';
  12. $this->path = 'task/v1/businesses/'.request('_business_info')['id'].'/tasks/';
  13. }
  14. public function files()
  15. {
  16. return $this->hasMany(File::class, 'attached_to_id', 'id')
  17. ->where('attached_to_table', enum('tables.tasks.id'));
  18. }
  19. }