4f54340e89
Backend: - table audits réellement alimentée via trait Auditable (observers Eloquent) sur Utilisateur, SaisieTracker, Feed, Emotion ; mot de passe jamais loggé - 4 nouveaux tests (19/19 au total) Frontend web: - en-tête/pied République Française ajoutés aux pages connexion/inscription - bouton variant danger réellement rouge (tokens erreur DSFR) Mobile: - ~30 libellés ré-accentués (Intensité, Succès, Déconnexion, Répartition...) - Colors.secondary = rouge Marianne #E1000F (différenciation cartes/icônes) - vrai camembert SVG des rapports (react-native-svg) Docs: plans oraux mis à jour (audits actif, 29 tests, stockage JWT en Q/R) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
49 lines
995 B
PHP
49 lines
995 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\Auditable;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Feed extends Model
|
|
{
|
|
use Auditable, HasFactory;
|
|
|
|
protected $table = 'feeds';
|
|
|
|
protected $fillable = [
|
|
'titre',
|
|
'slug',
|
|
'contenu',
|
|
'image_url',
|
|
'est_publie',
|
|
'auteur_id',
|
|
'ordre',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'est_publie' => 'boolean',
|
|
'ordre' => 'integer',
|
|
];
|
|
}
|
|
|
|
// ──── Relations ────
|
|
|
|
public function auteur(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Utilisateur::class, 'auteur_id');
|
|
}
|
|
|
|
// ──── Scopes ────
|
|
|
|
public function scopePublie(Builder $query): Builder
|
|
{
|
|
return $query->where('est_publie', true);
|
|
}
|
|
}
|