Init commit
This commit is contained in:
63
database/migrations/2025_01_23_190836_create_jobs_table.php
Normal file
63
database/migrations/2025_01_23_190836_create_jobs_table.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
|
||||
$table->boolean('is_active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
$this->seed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
}
|
||||
|
||||
public function seed(): void
|
||||
{
|
||||
$jobs = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Hellcase',
|
||||
'description' => 'Prends le daily free et rentre dans les concours. Tourne toutes les 24h.',
|
||||
'is_active' => false,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Jeu gratuit Epic Games',
|
||||
'description' => 'Prends le jeu gratuit Epic games. Tourne tous les mois et tous les jours pendant la période de Noël.',
|
||||
'is_active' => false,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Envoyer un post instagram',
|
||||
'description' => "Envoye un post instagram avec l'image et le texte fourni. Tourne tous les jours.",
|
||||
'is_active' => false,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($jobs as $job) {
|
||||
\App\Models\Job::forcecreate($job);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user