1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Valid projects with clients validation

This commit is contained in:
David Bomba 2020-10-16 20:12:37 +11:00
parent c7d7e71e78
commit 0717744c5a

View File

@ -13,6 +13,7 @@ namespace App\Http\Requests\Invoice;
use App\Http\Requests\Request;
use App\Http\ValidationRules\Invoice\UniqueInvoiceNumberRule;
use App\Http\ValidationRules\Project\ValidProjectForClient;
use App\Models\ClientContact;
use App\Models\Invoice;
use App\Utils\Traits\CleanLineItems;
@ -53,7 +54,7 @@ class StoreInvoiceRequest extends Request
$rules['number'] = new UniqueInvoiceNumberRule($this->all());
$rules['project_id'] = 'bail|sometimes|' . new ValidProjectForClient($this->all());
$rules['project_id'] = ['bail', 'sometimes', new ValidProjectForClient($this->all())];
return $rules;
}