* закончил окно редактирования карты с назначением номера в архиве
* добавил окно для редактирования выдачи / возврата карты * раздробил логику хранения карты
This commit is contained in:
@@ -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('orgs', function (Blueprint $table) {
|
||||
$table->string('code')->after('id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('orgs', function (Blueprint $table) {
|
||||
$table->dropColumn('code');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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('archive_statuses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('text');
|
||||
$table->string('variant');
|
||||
$table->boolean('has_user_set')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('archive_statuses');
|
||||
}
|
||||
};
|
||||
@@ -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('archive_infos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('historyable');
|
||||
$table->string('num');
|
||||
$table->date('post_in');
|
||||
$table->foreignIdFor(\App\Models\ArchiveStatus::class, 'status_id')->default(1);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('archive_infos');
|
||||
}
|
||||
};
|
||||
31
database/seeders/ArchiveStatusSeeder.php
Normal file
31
database/seeders/ArchiveStatusSeeder.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\ArchiveStatus;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ArchiveStatusSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
ArchiveStatus::create([
|
||||
'text' => 'Не определен',
|
||||
'variant' => 'default'
|
||||
]);
|
||||
|
||||
ArchiveStatus::create([
|
||||
'text' => 'В архиве',
|
||||
'variant' => 'success'
|
||||
]);
|
||||
|
||||
ArchiveStatus::create([
|
||||
'text' => 'Выдана',
|
||||
'variant' => 'warning'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,8 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
$this->call([
|
||||
ArchiveStatusSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user