diff --git a/app/Filament/Clusters/Loans/Loans/Tables/LoansTable.php b/app/Filament/Clusters/Loans/Loans/Tables/LoansTable.php index 5d77f49..35301cf 100644 --- a/app/Filament/Clusters/Loans/Loans/Tables/LoansTable.php +++ b/app/Filament/Clusters/Loans/Loans/Tables/LoansTable.php @@ -4,6 +4,7 @@ namespace App\Filament\Clusters\Loans\Loans\Tables; use App\Modules\Loan\Filaments\Actions\ShowLoanRemainingAction; use Filament\Actions\BulkActionGroup; +use Filament\Actions\DeleteAction; use Filament\Actions\DeleteBulkAction; use Filament\Actions\EditAction; use Filament\Tables\Columns\TextColumn; @@ -34,6 +35,7 @@ class LoansTable ->recordActions([ ShowLoanRemainingAction::make(), EditAction::make(), + DeleteAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ diff --git a/app/Modules/LoanPaidOffLetter/Controllers/LoanPaidOffLetterController.php b/app/Modules/LoanPaidOffLetter/Controllers/LoanPaidOffLetterController.php new file mode 100644 index 0000000..3d9e23c --- /dev/null +++ b/app/Modules/LoanPaidOffLetter/Controllers/LoanPaidOffLetterController.php @@ -0,0 +1,49 @@ +id(); + + $table->string('unique_id')->nullable()->unique(); + $table->string('region', 2)->index(); + $table->foreignId('branch_id')->constrained('branches')->restrictOnDelete(); + + $table->string('customer_name')->index(); + $table->string('customer_surname')->index(); + $table->string('customer_patronic_name')->nullable(); + $table->date('born_at')->nullable(); + + $table->string('phone')->nullable()->index(); + + $table->string('passport_serie')->index(); + $table->string('passport_id')->index(); + + $table->string('status')->nullable()->index(); + + $table->text('notes')->nullable(); + + $table->foreignId('user_id')->constrained('users')->restrictOnDelete(); + + $table->string('loan_contract_number')->nullable(); + $table->string('loan_contract_date')->nullable(); + $table->string('loan_amount')->nullable(); + $table->string('loan_reason')->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/app/Modules/LoanPaidOffLetter/LoanPaidOffLetterModule.php b/app/Modules/LoanPaidOffLetter/LoanPaidOffLetterModule.php new file mode 100644 index 0000000..bb8f6b2 --- /dev/null +++ b/app/Modules/LoanPaidOffLetter/LoanPaidOffLetterModule.php @@ -0,0 +1,64 @@ +enabled; + } + + /** + * Disable module + */ + public function disable(): void + { + $this->enabled = false; + } + + /** + * Enable module + */ + public function enable(): void + { + $this->enabled = true; + } + + /** + * Check if module has a filament resource + */ + public function hasFilamentResource(): bool + { + return false; + } + + /** + * Get module composer requirements + */ + public function getComposerRequirements(): array + { + return []; + } + + /** + * Get module composer suggestions + */ + public function getComposerSuggestions(): array + { + return []; + } +} diff --git a/app/Modules/LoanPaidOffLetter/Models/LoanPaidOffLetter.php b/app/Modules/LoanPaidOffLetter/Models/LoanPaidOffLetter.php new file mode 100644 index 0000000..036622f --- /dev/null +++ b/app/Modules/LoanPaidOffLetter/Models/LoanPaidOffLetter.php @@ -0,0 +1,60 @@ + 'date', + 'loan_contract_date' => 'date', + ]; + + /** + * User + * + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + + /** + * Branch + * + * @return BelongsTo + */ + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class); + } +} diff --git a/app/Modules/LoanPaidOffLetter/Repositories/LoanPaidOffLetterRepository.php b/app/Modules/LoanPaidOffLetter/Repositories/LoanPaidOffLetterRepository.php new file mode 100644 index 0000000..405d539 --- /dev/null +++ b/app/Modules/LoanPaidOffLetter/Repositories/LoanPaidOffLetterRepository.php @@ -0,0 +1,5 @@ +discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets') ->widgets([ AccountWidget::class, - FilamentInfoWidget::class, ]) ->middleware([ EncryptCookies::class,