- Introduced CashAccountController for managing cash accounts. - Created CashTransactionRequest and CashAccountRequest for transaction validation. - Developed CashAccountService to handle business logic for cash transactions. - Added UI components for cash account management, including deposit and withdrawal dialogs. - Implemented data tables for displaying transactions and cash account details. - Updated routes to include cash account management endpoints. - Added tests for cash account functionality, including deposit and withdrawal operations.
41 lines
816 B
PHP
41 lines
816 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Finance;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Override;
|
|
|
|
class CashTransactionRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#[Override]
|
|
public function prepareForValidation()
|
|
{
|
|
if ($this->has('amount')) {
|
|
$this->merge([
|
|
'amount' => str_replace('.', '', $this->amount),
|
|
]);
|
|
}
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'amount' => ['required', 'integer', 'min:1'],
|
|
'description' => ['required', 'string', 'max:100'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'amount' => 'jumlah',
|
|
'description' => 'keterangan',
|
|
];
|
|
}
|
|
}
|