-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from Crudzaso/develop
Develop
- Loading branch information
Showing
4 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
database/migrations/2024_12_09_080953_update_lotteries_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?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::table('lotteries', function (Blueprint $table) { | ||
$table->text('description')->nullable()->change(); | ||
$table->string('url_imagen')->nullable()->change(); | ||
|
||
$table->string('slug')->unique()->after('name'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('lotteries', function (Blueprint $table) { | ||
$table->text('description')->nullable(false)->change(); | ||
$table->string('url_imagen')->nullable(false)->change(); | ||
$table->dropColumn('slug'); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
use Modules\Lottery\Models\Lottery; | ||
|
||
class LotterySeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
$lotteries = [ | ||
["name" => "ANTIOQUEÑITA MAÑANA FESTIVO", "slug" => "antioquenita-manana-festivo"], | ||
["name" => "ANTIOQUEÑITA TARDE FESTIVO", "slug" => "antioquenita-tarde-festivo"], | ||
["name" => "CARIBEÑA DIA FESTIVO", "slug" => "caribena-dia-festivo"], | ||
["name" => "CHONTICO DIA FESTIVO", "slug" => "chontico-dia-festivo"], | ||
["name" => "CULONA DIA FESTIVO", "slug" => "culona-dia-festivo"], | ||
["name" => "MOTILON DIA", "slug" => "motilon-dia"], | ||
["name" => "PAISITA DIA FESTIVO", "slug" => "paisita-dia-festivo"], | ||
["name" => "SAMAN FESTIVO", "slug" => "saman-festivo"], | ||
["name" => "SINUANO DIA FESTIVO", "slug" => "sinuano-dia-festivo"], | ||
["name" => "ANTIOQUEÑITA FESTIVA MAÑANA", "slug" => "antioqueaita-festiva-maaana"], | ||
["name" => "ANTIOQUEÑITA FESTIVA TARDE", "slug" => "antioqueaita-festiva-tarde"], | ||
["name" => "ANTIOQUEÑITA MAÑANA", "slug" => "antioqueaita-maaana"], | ||
["name" => "ANTIOQUEÑITA TARDE", "slug" => "antioqueaita-tarde"], | ||
["name" => "ANTIOQUEÑITA FESTIVA MAÑANA", "slug" => "antioquenita-festiva-manana"], | ||
["name" => "ANTIOQUEÑITA FESTIVA TARDE", "slug" => "antioquenita-festiva-tarde"], | ||
["name" => "ANTIOQUEÑITA MAÑANA", "slug" => "antioquenita-manana"], | ||
["name" => "ANTIOQUEÑITA TARDE", "slug" => "antioquenita-tarde"], | ||
["name" => "AST-LUN 21:50", "slug" => "ast-lun-2150"], | ||
["name" => "AST-SOL 13:50", "slug" => "ast-sol-1350"], | ||
["name" => "ASTRO LUNA", "slug" => "astro-luna"], | ||
["name" => "ASTRO SOL", "slug" => "astro-sol"], | ||
["name" => "BOGOTA", "slug" => "bogota"], | ||
["name" => "BOYACA", "slug" => "boyaca"], | ||
["name" => "CAFETERITO FESTIVO", "slug" => "cafeterito-festivo"], | ||
["name" => "CAFETERITO NOCHE", "slug" => "cafeterito-noche"], | ||
["name" => "CAFETERITO NOCHE FESTIVO", "slug" => "cafeterito-noche-festivo"], | ||
["name" => "CAFETERO", "slug" => "cafetero"], | ||
["name" => "CAFETERO DIA", "slug" => "cafetero-dia"], | ||
["name" => "CAFETERO NOCHE", "slug" => "cafetero-noche"], | ||
["name" => "CAFETERO NOCHE FESTIVO", "slug" => "cafetero-noche-festivo"], | ||
["name" => "CARIBEÑA DIA", "slug" => "caribeaa-dia"], | ||
["name" => "CARIBEÑA FESTIVO DIA", "slug" => "caribeaa-festivo-dia"], | ||
["name" => "CARIBEÑA NOCHE", "slug" => "caribeaa-noche"], | ||
["name" => "CARIBEÑA DIA", "slug" => "caribena-dia"], | ||
["name" => "CARIBEÑA FESTIVA NOCHE", "slug" => "caribena-festiva-noche"], | ||
["name" => "CARIBEÑA FESTIVO DIA", "slug" => "caribena-festivo-dia"], | ||
["name" => "CARIBEÑA NOCHE", "slug" => "caribena-noche"], | ||
["name" => "CARIBEÑA NOCHE FESTIVO", "slug" => "caribena-noche-festivo"], | ||
["name" => "CAUCA", "slug" => "cauca"], | ||
["name" => "CHONTICO", "slug" => "chontico"], | ||
["name" => "CHONTICO DIA", "slug" => "chontico-dia"], | ||
["name" => "CHONTICO FESTIVO", "slug" => "chontico-festivo"], | ||
["name" => "CHONTICO FESTIVO DIA", "slug" => "chontico-festivo-dia"], | ||
["name" => "CHONTICO NOCHE", "slug" => "chontico-noche"], | ||
["name" => "CHONTICO NOCHE FESTIVO", "slug" => "chontico-noche-festivo"], | ||
["name" => "CHONTICO NOCHE JUEVES", "slug" => "chontico-noche-jueves"], | ||
["name" => "CRUZ ROJA", "slug" => "cruz-roja"], | ||
["name" => "CULONA", "slug" => "culona"], | ||
["name" => "CULONA DIA", "slug" => "culona-dia"], | ||
["name" => "CULONA FESTIVO", "slug" => "culona-festivo"], | ||
["name" => "CULONA FESTIVO DIA", "slug" => "culona-festivo-dia"], | ||
["name" => "CULONA FESTIVO NOCHE", "slug" => "culona-festivo-noche"], | ||
["name" => "CULONA NOCHE", "slug" => "culona-noche"], | ||
["name" => "CULONA NOCHE FESTIVO", "slug" => "culona-noche-festivo"], | ||
["name" => "CUNDINAMARCA", "slug" => "cundinamarca"], | ||
["name" => "DORADO", "slug" => "dorado"], | ||
["name" => "DORADO FESTIVO", "slug" => "dorado-festivo"], | ||
["name" => "DORADO MAÑANA", "slug" => "dorado-manana"], | ||
["name" => "DORADO NOCHE", "slug" => "dorado-noche"], | ||
["name" => "DORADO NOCHE FESTIVO", "slug" => "dorado-noche-festivo"], | ||
["name" => "DORADO TARDE", "slug" => "dorado-tarde"], | ||
["name" => "EXTRA CRUZ ROJA", "slug" => "extra-cruz-roja"], | ||
["name" => "EXTRA DE COLOMBIA", "slug" => "extra-de-colombia"], | ||
["name" => "FANTASTICA DIA", "slug" => "fantastica-dia"], | ||
["name" => "FANTASTICA NOCHE", "slug" => "fantastica-noche"], | ||
["name" => "FANTASTICA NOCHE FESTIVO", "slug" => "fantastica-noche-festivo"], | ||
["name" => "HUILA", "slug" => "huila"], | ||
["name" => "LA FANTASTICA DIA", "slug" => "la-fantastica-dia"], | ||
["name" => "LA FANTASTICA FESTIVO", "slug" => "la-fantastica-festivo"], | ||
["name" => "LA FANTASTICA NOCHE", "slug" => "la-fantastica-noche"], | ||
["name" => "LA FANTASTICA NOCHE FESTIVO", "slug" => "la-fantastica-noche-festivo"], | ||
["name" => "MANIZALES", "slug" => "manizales"], | ||
["name" => "MEDELLIN", "slug" => "medellin"], | ||
["name" => "META", "slug" => "meta"], | ||
["name" => "MOTILON", "slug" => "motilon"], | ||
["name" => "MOTILON FESTIVO", "slug" => "motilon-festivo"], | ||
["name" => "MOTILON NOCHE", "slug" => "motilon-noche"], | ||
["name" => "PAISITA 3 SABADOS", "slug" => "paisita-3-sabados"], | ||
["name" => "PAISITA DIA", "slug" => "paisita-dia"], | ||
["name" => "PAISITA FESTIVO", "slug" => "paisita-festivo"], | ||
["name" => "PAISITA FESTIVO DIA", "slug" => "paisita-festivo-dia"], | ||
["name" => "PAISITA FESTIVO NOCHE", "slug" => "paisita-festivo-noche"], | ||
["name" => "PAISITA NOCHE", "slug" => "paisita-noche"], | ||
["name" => "PAISITA NOCHE FESTIVO", "slug" => "paisita-noche-festivo"], | ||
["name" => "PIJAO", "slug" => "pijao"], | ||
["name" => "PIJAO FESTIVO", "slug" => "pijao-festivo"], | ||
["name" => "PIJAO NOCHE FESTIVO", "slug" => "pijao-noche-festivo"], | ||
["name" => "QUINDIO", "slug" => "quindio"], | ||
["name" => "RISARALDA", "slug" => "risaralda"], | ||
["name" => "SAMAN", "slug" => "saman"], | ||
["name" => "SAMANFESTIVO", "slug" => "samanfestivo"], | ||
["name" => "SANTANDER", "slug" => "santander"], | ||
["name" => "SINUANO DIA", "slug" => "sinuano-dia"], | ||
["name" => "SINUANO FESTIVO DIA", "slug" => "sinuano-festivo-dia"], | ||
["name" => "SINUANO FESTIVO NOCHE", "slug" => "sinuano-festivo-noche"], | ||
["name" => "SINUANO NOCHE", "slug" => "sinuano-noche"], | ||
["name" => "SINUANO NOCHE FESTIVO", "slug" => "sinuano-noche-festivo"], | ||
["name" => "SORTEO EXTRA CAUCA", "slug" => "sorteo-extra-cauca"], | ||
["name" => "SORTEO EXTRA CRUZROJA-VALLE", "slug" => "sorteo-extra-cruzroja-valle"], | ||
["name" => "SORTEO EXTRA DE BOGOTA", "slug" => "sorteo-extra-de-bogota"], | ||
["name" => "SORTEO EXTRA DE BOYACA", "slug" => "sorteo-extra-de-boyaca"], | ||
["name" => "SORTEO EXTRA DE MANIZALES", "slug" => "sorteo-extra-de-manizales"], | ||
["name" => "SORTEO EXTRA DEL TOLIMA", "slug" => "sorteo-extra-del-tolima"], | ||
["name" => "SORTEO EXTRA SANTANDER", "slug" => "sorteo-extra-santander"], | ||
["name" => "SUPER EXTRA MEDELLIN", "slug" => "super-extra-medellin"], | ||
["name" => "SUPER EXTRA NAVIDAD MEDELLIN", "slug" => "super-extra-navidad-medellin"], | ||
["name" => "TOLIMA", "slug" => "tolima"], | ||
["name" => "VALLE", "slug" => "valle"] | ||
]; | ||
|
||
foreach ($lotteries as $lottery) { | ||
Lottery::create([ | ||
'name' => $lottery['name'], | ||
'slug' => $lottery['slug'], | ||
'description' => 'Descripción predeterminada para la lotería ' . $lottery['name'], | ||
'url_imagen' => 'https://via.placeholder.com/150', // URL de imagen predeterminada | ||
]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters