diff --git a/.DS_Store b/.DS_Store
index 4f9b482..e00adff 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/app/Models/User.php b/app/Models/User.php
index 4d7f70f..1713f3d 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -7,10 +7,12 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
+use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
+ use HasRoles;
/**
* The attributes that are mass assignable.
diff --git a/app/Nova/Resources/Order/Loan/LoanType.php b/app/Nova/Resources/Order/Loan/LoanType.php
index 325dfb4..5621fee 100644
--- a/app/Nova/Resources/Order/Loan/LoanType.php
+++ b/app/Nova/Resources/Order/Loan/LoanType.php
@@ -2,6 +2,7 @@
namespace App\Nova\Resources\Order\Loan;
+use App\Models\Order\Loan\LoanType as LoanTypeModel;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
@@ -9,7 +10,6 @@ use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Trin4ik\NovaSwitcher\NovaSwitcher;
-use \App\Models\Order\Loan\LoanType as LoanTypeModel;
class LoanType extends Resource
{
@@ -38,15 +38,12 @@ class LoanType extends Resource
/**
* Get the fields displayed by the resource.
- *
- * @param \Laravel\Nova\Http\Requests\NovaRequest $request
- * @return array
*/
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
-
+
Text::make(__('Name'), 'name')
->rules('required', 'string', 'max:255')
->translatable(),
@@ -67,9 +64,6 @@ class LoanType extends Resource
/**
* Get the cards available for the request.
- *
- * @param \Laravel\Nova\Http\Requests\NovaRequest $request
- * @return array
*/
public function cards(NovaRequest $request): array
{
@@ -78,9 +72,6 @@ class LoanType extends Resource
/**
* Get the filters available for the resource.
- *
- * @param \Laravel\Nova\Http\Requests\NovaRequest $request
- * @return array
*/
public function filters(NovaRequest $request): array
{
@@ -89,9 +80,6 @@ class LoanType extends Resource
/**
* Get the lenses available for the resource.
- *
- * @param \Laravel\Nova\Http\Requests\NovaRequest $request
- * @return array
*/
public function lenses(NovaRequest $request): array
{
@@ -100,9 +88,6 @@ class LoanType extends Resource
/**
* Get the actions available for the resource.
- *
- * @param \Laravel\Nova\Http\Requests\NovaRequest $request
- * @return array
*/
public function actions(NovaRequest $request): array
{
diff --git a/config/nova.php b/config/nova.php
index f5defd5..0025858 100644
--- a/config/nova.php
+++ b/config/nova.php
@@ -163,7 +163,7 @@ return [
*/
'brand' => [
- // 'logo' => resource_path('/img/example-logo.svg'),
+ 'logo' => public_path('/assets/images/logo.svg'),
'colors' => [
'400' => '24, 182, 155, 0.5',
diff --git a/database/migrations/2023_11_23_162920_create_loan_orders_table.php b/database/migrations/2023_11_23_162920_create_loan_orders_table.php
index 0af567f..ce550df 100644
--- a/database/migrations/2023_11_23_162920_create_loan_orders_table.php
+++ b/database/migrations/2023_11_23_162920_create_loan_orders_table.php
@@ -26,7 +26,7 @@ return new class extends Migration
$table->string('passport_address');
$table->string('real_address');
-
+
$table->string('passport_serie')->index();
$table->integer('passport_id')->index();
$table->date('passport_given_at');
@@ -50,11 +50,11 @@ return new class extends Migration
$table->string('education');
$table->string('marriage_status');
-
+
$table->text('passport_one');
- $table->text('passport_two');
+ $table->text('passport_two');
$table->text('passport_three');
- $table->text('passport_four');
+ $table->text('passport_four');
$table->foreignId('filled_by')->constrained('users')->restrictOnDelete();
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
diff --git a/database/seeders/BranchTableSeeder.php b/database/seeders/BranchTableSeeder.php
index 3f2326d..7267ebf 100644
--- a/database/seeders/BranchTableSeeder.php
+++ b/database/seeders/BranchTableSeeder.php
@@ -2,7 +2,7 @@
namespace Database\Seeders;
-use Illuminate\Database\Console\Seeds\WithoutModelEvents;
+use App\Models\Branch\Branch;
use Illuminate\Database\Seeder;
class BranchTableSeeder extends Seeder
@@ -157,9 +157,9 @@ class BranchTableSeeder extends Seeder
'region' => 'dz',
'created_at' => '2022-12-10 13:23:15',
'updated_at' => '2022-12-10 13:39:24',
- ],
+ ],
];
Branch::insert($branches);
- }
+ }
}
diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php
index 984503d..cdacab5 100644
--- a/database/seeders/DatabaseSeeder.php
+++ b/database/seeders/DatabaseSeeder.php
@@ -3,9 +3,7 @@
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
-use App\Models\User;
use Illuminate\Database\Seeder;
-use Spatie\Permission\Models\Role;
class DatabaseSeeder extends Seeder
{
@@ -14,50 +12,8 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
- $this->createRoles();
- $this->createAdmins();
- }
-
- public function createRoles(): void
- {
- if (Role::count() > 0) {
- return;
- }
-
- $roles = [
- 'king',
- 'superadmin',
- 'admin',
- 'operator',
- 'user',
- ];
-
- foreach ($roles as $role) {
- Role::create(['name' => $role]);
- }
- }
-
- public function createAdmins(): void
- {
- $admins = [
- [
- 'name' => 'Nurmuhammet Allanov',
- 'email' => 'nurmuhammet@mail.com',
- 'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
- ], [
- 'name' => 'Mahmyt Allaberdiyev',
- 'email' => 'mahmyt1206@gmail.com',
- 'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
- ], [
- 'name' => 'Döwran Myratlyýew',
- 'email' => 'dovran.m@mail.ru',
- 'password' => '$2y$10$EFQaBb.aM2KJRGGtuhjdM.3m4Mtm/vw68NjU2280d2RICDGI.o336',
- ],
- ];
-
- foreach ($admins as $admin) {
- $user = User::create($admin);
- $user->assignRole('superadmin');
- }
+ $this->call([BranchTableSeeder::class]);
+ $this->call([UsersTableSeeder::class]);
+ $this->call([LoanTypeSeeder::class]);
}
}
diff --git a/database/seeders/LoanTypeSeeder.php b/database/seeders/LoanTypeSeeder.php
new file mode 100644
index 0000000..7eaf347
--- /dev/null
+++ b/database/seeders/LoanTypeSeeder.php
@@ -0,0 +1,68 @@
+ [
+ 'tk' => 'Ýaş çatynjalara',
+ 'ru' => 'Кредит “Молодожёнам”',
+ ],
+ 'tax' => 1,
+ 'maturity' => 30,
+ 'notes' => '',
+ 'active' => true,
+ ], [
+ 'name' => [
+ 'tk' => 'Üpjünçiligine zamunlyk bolan sarp ediş karzy',
+ 'ru' => 'Потребительский кредит под поручительство',
+ ],
+ 'tax' => 1,
+ 'maturity' => 30,
+ 'notes' => '',
+ 'active' => true,
+ ], [
+ 'name' => [
+ 'tk' => 'Kiçi göwrümli karzlar',
+ 'ru' => 'Микро кредиты',
+ ],
+ 'tax' => 1,
+ 'maturity' => 30,
+ 'notes' => '',
+ 'active' => true,
+ ], [
+ 'name' => [
+ 'tk' => 'Üpjünçiligine girew emlägi bolan sarp ediş karzy',
+ 'ru' => 'Потребительский кредит под залог имущества',
+ ],
+ 'tax' => 1,
+ 'maturity' => 30,
+ 'notes' => '',
+ 'active' => true,
+ ], [
+ 'name' => [
+ 'tk' => 'Talyp karzy',
+ 'ru' => 'Кредит “Студенческий”',
+ ],
+ 'tax' => 1,
+ 'maturity' => 30,
+ 'notes' => '',
+ 'active' => true,
+ ],
+ ];
+
+ foreach ($datas as $data) {
+ LoanType::create($data);
+ }
+ }
+}
diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php
new file mode 100644
index 0000000..c019053
--- /dev/null
+++ b/database/seeders/UsersTableSeeder.php
@@ -0,0 +1,62 @@
+createRoles();
+ $this->createAdmins();
+ }
+
+ public function createRoles(): void
+ {
+ if (Role::count() > 0) {
+ return;
+ }
+
+ $roles = [
+ 'king',
+ 'superadmin',
+ 'admin',
+ 'operator',
+ 'user',
+ ];
+
+ foreach ($roles as $role) {
+ Role::create(['name' => $role]);
+ }
+ }
+
+ public function createAdmins(): void
+ {
+ $admins = [
+ [
+ 'name' => 'Nurmuhammet Allanov',
+ 'email' => 'nurmuhammet@mail.com',
+ 'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
+ ], [
+ 'name' => 'Mahmyt Allaberdiyev',
+ 'email' => 'mahmyt1206@gmail.com',
+ 'password' => '$2y$10$O7LFNdFIT3Rmfeo8tUfbqekB0x0incovkRP6eQuzvb7dVXysQyyBC',
+ ], [
+ 'name' => 'Döwran Myratlyýew',
+ 'email' => 'dovran.m@mail.ru',
+ 'password' => '$2y$10$EFQaBb.aM2KJRGGtuhjdM.3m4Mtm/vw68NjU2280d2RICDGI.o336',
+ ],
+ ];
+
+ foreach ($admins as $admin) {
+ $user = User::create($admin);
+ $user->assignRole('superadmin');
+ }
+ }
+}
diff --git a/public/assets/images/logo.svg b/public/assets/images/logo.svg
new file mode 100644
index 0000000..5a0f510
--- /dev/null
+++ b/public/assets/images/logo.svg
@@ -0,0 +1,3017 @@
+
+
+
diff --git a/public/ok.svg b/public/ok.svg
deleted file mode 100644
index 7112a0f..0000000
--- a/public/ok.svg
+++ /dev/null
@@ -1 +0,0 @@
-