36 lines
722 B
PHP
36 lines
722 B
PHP
<?php
|
|
|
|
namespace App\Abstracts\Http;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest as BaseFormRequest;
|
|
use Illuminate\Support\Arr;
|
|
|
|
abstract class FormRequest extends BaseFormRequest
|
|
{
|
|
/**
|
|
* Prepare the data for validation.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function prepareForValidation()
|
|
{
|
|
$this->merge([
|
|
'company_id' => company_id(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Determine if the given offset exists.
|
|
*
|
|
* @param string $offset
|
|
* @return bool
|
|
*/
|
|
public function offsetExists($offset)
|
|
{
|
|
return Arr::has(
|
|
$this->route() ? $this->all() + $this->route()->parameters() : $this->all(),
|
|
$offset
|
|
);
|
|
}
|
|
}
|