From 906b7045fa80b5081576f1e1e60ef1b097322466 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Fri, 3 Jan 2020 23:54:21 +0300 Subject: [PATCH] changed company id set in forms --- app/Abstracts/Http/FormRequest.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/Abstracts/Http/FormRequest.php b/app/Abstracts/Http/FormRequest.php index 090ee1653..1628789b1 100644 --- a/app/Abstracts/Http/FormRequest.php +++ b/app/Abstracts/Http/FormRequest.php @@ -8,22 +8,15 @@ use Illuminate\Support\Arr; abstract class FormRequest extends BaseFormRequest { /** - * Set the company id to the request. + * Prepare the data for validation. * - * @return \Illuminate\Contracts\Validation\Validator + * @return void */ - protected function getValidatorInstance() + protected function prepareForValidation() { - // Get request data - $data = $this->all(); - - // Add active company id - $data['company_id'] = session('company_id'); - - // Reset the request data - $this->getInputSource()->replace($data); - - return parent::getValidatorInstance(); + $this->merge([ + 'company_id' => session('company_id'), + ]); } /**