chore(app): mises a jour applicatives et normalisation du code (Laravel Pint)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 18:44:13 +02:00
parent c51f17a74c
commit 70d4767890
32 changed files with 144 additions and 89 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
namespace Database\Factories;
use App\Models\Role;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
@@ -30,7 +31,7 @@ class UserFactory extends Factory
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
'id_role' => \App\Models\Role::first() ?? \App\Models\Role::create(['libelle' => 'Utilisateur']),
'id_role' => Role::first() ?? Role::create(['libelle' => 'Utilisateur']),
];
}
@@ -4,13 +4,19 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->string('libelle');
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('roles'); }
public function down(): void
{
Schema::dropIfExists('roles');
}
};
@@ -4,8 +4,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
@@ -17,5 +19,9 @@ return new class extends Migration {
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('users'); }
public function down(): void
{
Schema::dropIfExists('users');
}
};
@@ -4,8 +4,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('stress_events', function (Blueprint $table) {
$table->id();
$table->string('event_name');
@@ -13,5 +15,9 @@ return new class extends Migration {
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('stress_events'); }
public function down(): void
{
Schema::dropIfExists('stress_events');
}
};
@@ -4,8 +4,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('relaxation_activities', function (Blueprint $table) {
$table->id();
$table->string('title');
@@ -17,5 +19,9 @@ return new class extends Migration {
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('relaxation_activities'); }
public function down(): void
{
Schema::dropIfExists('relaxation_activities');
}
};
@@ -4,8 +4,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('resultat_diags', function (Blueprint $table) {
$table->id();
$table->foreignId('id_user')->constrained('users')->onDelete('cascade');
@@ -16,5 +18,9 @@ return new class extends Migration {
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('resultat_diags'); }
public function down(): void
{
Schema::dropIfExists('resultat_diags');
}
};
@@ -4,8 +4,10 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
return new class extends Migration
{
public function up(): void
{
Schema::create('emotion_records', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
@@ -15,5 +17,9 @@ return new class extends Migration {
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('emotion_records'); }
public function down(): void
{
Schema::dropIfExists('emotion_records');
}
};
+1 -1
View File
@@ -2,8 +2,8 @@
namespace Database\Seeders;
use App\Models\User;
use App\Models\Role;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
@@ -16,7 +16,7 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'audio',
'category' => 'Méditation',
'url' => 'https://www.youtube.com/watch?v=sz7cpV7ERsY',
'image_url' => 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
'image_url' => 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
[
'title' => 'Yoga Doux pour le Soir',
@@ -24,7 +24,7 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'video',
'category' => 'Sport',
'url' => 'https://www.youtube.com/watch?v=v7AYKMP6rOE',
'image_url' => 'https://images.unsplash.com/photo-1544367567-0f2fcb009e0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
'image_url' => 'https://images.unsplash.com/photo-1544367567-0f2fcb009e0b?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
[
'title' => 'Bruits de Plage et Vagues',
@@ -32,7 +32,7 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'audio',
'category' => 'Musique',
'url' => 'https://www.youtube.com/watch?v=0_fS_pS_B0U',
'image_url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
'image_url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
[
'title' => 'Comprendre le Cycle du Stress',
@@ -40,7 +40,7 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'article',
'category' => 'Lecture',
'url' => 'https://www.santepubliquefrance.fr',
'image_url' => 'https://images.unsplash.com/photo-1512820790803-83ca734da794?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
'image_url' => 'https://images.unsplash.com/photo-1512820790803-83ca734da794?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
[
'title' => 'Musique Classique pour la Concentration',
@@ -48,7 +48,7 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'audio',
'category' => 'Musique',
'url' => 'https://www.youtube.com/watch?v=5Qq3m9G4_4A',
'image_url' => 'https://images.unsplash.com/photo-1514119412350-e174d90d280e?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
'image_url' => 'https://images.unsplash.com/photo-1514119412350-e174d90d280e?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
[
'title' => 'Techniques de Respiration Wim Hof',
@@ -56,8 +56,8 @@ class RelaxationActivitySeeder extends Seeder
'type' => 'video',
'category' => 'Respiration',
'url' => 'https://www.youtube.com/watch?v=tybOi4hjZFQ',
'image_url' => 'https://images.unsplash.com/photo-1518199266791-5375a83190b7?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80'
]
'image_url' => 'https://images.unsplash.com/photo-1518199266791-5375a83190b7?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80',
],
];
foreach ($activities as $activity) {
+2 -2
View File
@@ -2,7 +2,7 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\Role;
use Illuminate\Database\Seeder;
class RoleSeeder extends Seeder
@@ -18,7 +18,7 @@ class RoleSeeder extends Seeder
];
foreach ($roles as $role) {
\App\Models\Role::create($role);
Role::create($role);
}
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\StressEvent;
use Illuminate\Database\Seeder;
class StressEventSeeder extends Seeder
@@ -56,7 +56,7 @@ class StressEventSeeder extends Seeder
];
foreach ($events as $event) {
\App\Models\StressEvent::create($event);
StressEvent::create($event);
}
}
}