changed company id set in forms
This commit is contained in:
parent
f6e0c4dfc2
commit
906b7045fa
@ -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'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user