first commit

This commit is contained in:
Eric Li
2025-06-13 12:09:50 +08:00
commit b12cd07419
545 changed files with 39389 additions and 0 deletions

1
database/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sqlite*

View File

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -0,0 +1,32 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};

View File

@ -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::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('password_reset_tokens');
}
};

View File

@ -0,0 +1,32 @@
<?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('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('failed_jobs');
}
};

View File

@ -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::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};

View File

@ -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('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sessions');
}
};

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEventRegistrationInfosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('event_registration_infos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('title');
$table->text('content');
$table->boolean('enable')->default(false);
$table->timestamp('event_start_date')->useCurrent();
$table->timestamp('event_end_date')->useCurrent();
$table->integer('limit')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('event_registration_infos');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEventMetabolismsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('event_metabolisms', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('hospital_name');
$table->text('name');
$table->text('twid');
$table->text('phone');
$table->text('email');
$table->text('address');
$table->text('record_card_img_src');
$table->text('twid_front_img_src');
$table->text('twid_back_img_src');
$table->integer('check_state')->default(0);
$table->text('check_reson')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('event_metabolisms');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEventImprovedHealthsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('event_improved_healths', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('hospital_name');
$table->text('name');
$table->text('twid');
$table->text('phone');
$table->text('email');
$table->text('address');
$table->text('record_card_img_src');
$table->text('twid_front_img_src');
$table->text('twid_back_img_src');
$table->integer('check_state')->default(0);
$table->text('check_reson')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('event_improved_healths');
}
}

View File

@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEventHealthAllowancesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('event_health_allowances', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('hospital_name');
$table->text('name');
$table->text('twid');
$table->text('phone');
$table->text('email');
$table->text('address');
$table->text('record_card_img_src');
$table->text('twid_front_img_src');
$table->text('twid_back_img_src');
$table->text('exam_1st_img_src');
$table->text('exam_2nd_img_src');
$table->integer('check_state')->default(0);
$table->text('check_reson')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('event_health_allowances');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNewsCatalogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news_catalogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('parent_id')->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(1);
$table->boolean('is_front_show')->default(true);
$table->text('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news_catalogs');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('news_catalog_id')->default(0);
$table->boolean('is_front_show')->default(true);
$table->dateTime('post_at')->useCurrent();
$table->text('seo_title')->nullable();
$table->text('seo_keyword')->nullable();
$table->text('seo_description')->nullable();
$table->text('title');
$table->text('description');
$table->text('body');
$table->text('source_links')->nullable();
$table->text('photos')->nullalbe();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHealthInfoCatalogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('health_info_catalogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('parent_id')->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(1);
$table->boolean('is_front_show')->default(true);
$table->text('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('health_info_catalogs');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHealthInfosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('health_infos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('news_catalog_id')->default(0);
$table->boolean('is_front_show')->default(true);
$table->dateTime('post_at')->useCurrent();
$table->text('seo_title')->nullable();
$table->text('seo_keyword')->nullable();
$table->text('seo_description')->nullable();
$table->text('title');
$table->text('description');
$table->text('body');
$table->text('source_links')->nullable();
$table->text('photos')->nullalbe();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('health_infos');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNoticeCatalogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notice_catalogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('parent_id')->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(1);
$table->boolean('is_front_show')->default(true);
$table->text('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notice_catalogs');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNoticesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notices', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('news_catalog_id')->default(0);
$table->boolean('is_front_show')->default(true);
$table->dateTime('post_at')->useCurrent();
$table->text('seo_title')->nullable();
$table->text('seo_keyword')->nullable();
$table->text('seo_description')->nullable();
$table->text('title');
$table->text('description');
$table->text('body');
$table->text('source_links')->nullable();
$table->text('photos')->nullalbe();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notices');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFaqCatalogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('faq_catalogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('parent_id')->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(1);
$table->boolean('is_front_show')->default(true);
$table->text('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('faq_catalogs');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFaqsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('faqs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->biginteger('news_catalog_id')->default(0);
$table->boolean('is_front_show')->default(true);
$table->dateTime('post_at')->useCurrent();
$table->text('seo_title')->nullable();
$table->text('seo_keyword')->nullable();
$table->text('seo_description')->nullable();
$table->text('title');
$table->text('description');
$table->text('body');
$table->text('source_links')->nullable();
$table->text('photos')->nullalbe();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('faqs');
}
}

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('log_name')->nullable();
$table->text('description');
$table->nullableMorphs('subject', 'subject');
$table->nullableMorphs('causer', 'causer');
$table->json('properties')->nullable();
$table->timestamps();
$table->index('log_name');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
}

View File

@ -0,0 +1,22 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddEventColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->string('event')->nullable()->after('subject_type');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('event');
});
}
}

View File

@ -0,0 +1,22 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBatchUuidColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('batch_uuid');
});
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
}
}