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
|
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
|
$this->merge([
|
||||||
$data = $this->all();
|
'company_id' => session('company_id'),
|
||||||
|
]);
|
||||||
// Add active company id
|
|
||||||
$data['company_id'] = session('company_id');
|
|
||||||
|
|
||||||
// Reset the request data
|
|
||||||
$this->getInputSource()->replace($data);
|
|
||||||
|
|
||||||
return parent::getValidatorInstance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user