Gestions Projet: Models
Developpeur
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Developpeur extends Model
{
protected $table = "developpeurs";
protected $primaryKey = "idDev";
protected $fillable = ["nomDev", "prenomDev", "cv", "photoDev"];
public function Tache(){
return $this->hasMany(Tache::class, "idDev", "idDev");
}
}
Projet
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Projet extends Model
{
protected $table = "projets";
protected $primaryKey = "idP";
protected $fillable = ["nomP", "description", "photoP"];
public function Tache(){
return $this->hasMany(Tache::class, "idP", "idP");
}
}
Tache
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Tache extends Model
{
protected $table = "taches";
protected $primaryKey = "idT";
protected $fillable = ["idP", "idDev", "duree", "coutHeure", "etat"];
public function Projet()
{
return $this->belongsTo(Projet::class, "idP", "idP");
}
public function Developpeur()
{
return $this->belongsTo(Developpeur::class, "idDev", "idDev");
}
}