Implement file upload and viewing functionality; refactor letter migrations and models to use UUIDs
This commit is contained in:
@@ -11,15 +11,20 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('acceptance_letters', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nomor_surat');
|
||||
Schema::create('letters', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
// $table->string('nomor_surat');
|
||||
$table->string('nama_mahasiswa');
|
||||
$table->string('nomor_induk_mahasiswa');
|
||||
$table->string('program_studi_mahasiswa');
|
||||
$table->string('tahun_ajaran');
|
||||
$table->date('start_date');
|
||||
$table->date('completion_date');
|
||||
$table->string('lampiran')->nullable();
|
||||
$table->boolean('is_acceptance')->default(false);
|
||||
$table->string('nomor_surat_acceptance')->nullable();
|
||||
$table->boolean('is_completion')->default(false);
|
||||
$table->string('nomor_surat_completion')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -29,6 +34,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('acceptance_letters');
|
||||
Schema::dropIfExists('letters');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?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('completion_letters', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nomor_surat');
|
||||
$table->string('nama_mahasiswa');
|
||||
$table->string('nomor_induk_mahasiswa');
|
||||
$table->string('program_studi_mahasiswa');
|
||||
$table->string('tahun_ajaran');
|
||||
$table->date('completion_date');
|
||||
$table->string('lampiran')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('completion_letters');
|
||||
}
|
||||
};
|
||||
@@ -12,7 +12,7 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('completion_templates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('greeting');
|
||||
$table->text('content');
|
||||
$table->string('closing');
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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('file_uploads', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->uuid('letter_id')->nullable();
|
||||
$table->string('file_name');
|
||||
$table->string('file_path');
|
||||
$table->string('mime_type');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('file_uploads');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user