Skip to content

Commit

Permalink
Merge pull request #75 from Crudzaso/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DiegoAndresRamirez authored Nov 15, 2024
2 parents ddf9d84 + 829869c commit f7e006a
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
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::dropIfExists('multimedia');
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::create('multimedia', function (Blueprint $table) {
$table->id();
$table->string('file_name');
$table->string('file_path');
$table->enum('file_type', ['VIDEO', 'PDF', 'IMAGEN'])->nullable();
$table->string('mime_type', 50)->nullable();
$table->integer('size')->nullable();
$table->foreignId('raffle_id')->constrained('raffles')->onDelete('cascade');
$table->timestamps();
});
}
};
1 change: 1 addition & 0 deletions Modules/Raffle/app/Http/Controllers/RaffleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function update(Request $request, $id)
{
$request->validate([
'organizer_id' => 'required|exists:users,id',
'image' => 'nullable|string',
'lottery_id' => 'required|exists:lotteries,id',
'ticket_price' => 'required|numeric|min:0',
'total_tickets' => 'required|integer|min:1',
Expand Down
1 change: 1 addition & 0 deletions Modules/Raffle/app/Models/Raffle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Raffle extends Model

protected $fillable = [
'name',
'image',
'organizer_id',
'lottery_id',
'ticket_price',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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('raffles', function (Blueprint $table) {
$table->string('image')->nullable()->after('total_sales');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('raffles', function (Blueprint $table) {
$table->dropColumn('image');
});
}
};
2 changes: 1 addition & 1 deletion Modules/Raffle/resources/views/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!-- Imagen de la Rifa -->
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700">Imagen de la Rifa</label>
<input type="file" name="raffle_image" class="form-control" accept="image/*">
<input type="file" name="image" class="form-control" accept="image/*">
</div>

<!-- Total a Recaudar -->
Expand Down

0 comments on commit f7e006a

Please sign in to comment.