Project.php 619 B

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