wip on loanorders

This commit is contained in:
2023-11-26 21:15:42 +05:00
parent 11ad96e5d8
commit 307f197d27
9 changed files with 300 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
<?php
use App\Repos\Order\OrderRepo;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@@ -56,11 +57,11 @@ return new class extends Migration
$table->text('passport_three');
$table->text('passport_four');
$table->foreignId('filled_by')->constrained('users')->restrictOnDelete();
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
$table->foreignId('filled_by')->nullable()->constrained('users')->restrictOnDelete();
$table->foreignId('user_id')->nullable()->constrained('users')->restrictOnDelete();
$table->string('status')->index();
$table->string('status_reason')->nullable();
$table->string('status')->nullable()->default(OrderRepo::defaultStatus())->index();
$table->string('status_reason')->nullable()->default('');
$table->string('notes')->nullable();

View File

@@ -12,8 +12,11 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
$this->call([BranchTableSeeder::class]);
$this->call([UsersTableSeeder::class]);
$this->call([LoanTypeSeeder::class]);
$this->call([
UsersTableSeeder::class,
ProvinceTableSeeder::class,
BranchTableSeeder::class,
LoanTypeSeeder::class,
]);
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace Database\Seeders;
use App\Models\System\Location\Province;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ProvinceTableSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$datas = [
[
'region' => 'ag',
'name' => 'Arçabil',
'active' => true,
],
[
'region' => 'ag',
'name' => 'Bagtyýarlyk',
'active' => true,
],
[
'region' => 'ag',
'name' => 'Berkararlyk',
'active' => true,
],
[
'region' => 'ag',
'name' => 'Çandybil',
'active' => true,
],
[
'region' => 'ag',
'name' => 'Köpetdag',
'active' => true,
],
[
'region' => 'ah',
'name' => 'Altyn-Asyr',
'active' => true,
],
[
'region' => 'ah',
'name' => 'Ak-Bugdaý',
'active' => true,
],
[
'region' => 'mr',
'name' => 'Mary',
'active' => true,
],
];
foreach ($datas as $data) {
Province::create($data);
}
}
}