Task.php 606 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Task extends Model
  5. {
  6. public $timestamps = false;
  7. protected $table = "task";
  8. public function user()
  9. {
  10. return $this->hasOne('App\User','id','user_id');
  11. }
  12. public function proj_name()
  13. {
  14. return $this->hasOne('App\Models\Project', 'id', 'proj_id');
  15. }
  16. public function company_name()
  17. {
  18. return $this->hasOne('App\Models\CompanyModel','id','client_id');
  19. }
  20. public function assigned_tasks()
  21. {
  22. return $this->hasMany('App\Models\AssignTask');
  23. }
  24. }