mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-08-04 23:22:12 +00:00
fix(invoices): require settlement before completion (#739)
This commit is contained in:
committed by
GitHub
parent
00c9c4268e
commit
1e72d9d449
34
app/Http/Requests/ChangeInvoiceStatusRequest.php
Normal file
34
app/Http/Requests/ChangeInvoiceStatusRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class ChangeInvoiceStatusRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => [
|
||||
'required',
|
||||
Rule::in([
|
||||
Invoice::STATUS_SENT,
|
||||
Invoice::STATUS_COMPLETED,
|
||||
]),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user