e3da625927
- Backend Laravel 11 (API REST, JWT auth, PostgreSQL) - Frontend Next.js 14 (React, TypeScript, Tailwind CSS) - Docker Compose (PostgreSQL, backend, frontend) - Modules : auth, profil, tracker émotions, informations, admin
33 lines
657 B
PHP
33 lines
657 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Tracker extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'trackers';
|
|
|
|
protected $fillable = [
|
|
'utilisateur_id',
|
|
'nom',
|
|
];
|
|
|
|
// ──── Relations ────
|
|
|
|
public function utilisateur(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Utilisateur::class);
|
|
}
|
|
|
|
public function saisies(): HasMany
|
|
{
|
|
return $this->hasMany(SaisieTracker::class);
|
|
}
|
|
}
|