Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
32 lines
758 B
PHP
32 lines
758 B
PHP
<?php
|
|
|
|
namespace Modules\EcommerceFinance\Http\Requests;
|
|
|
|
use App\Abstracts\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class Channel extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'code' => [
|
|
'required',
|
|
'string',
|
|
'max:64',
|
|
Rule::unique('ec_channels', 'code')
|
|
->where('company_id', company_id())
|
|
->ignore($this->route('channel')),
|
|
],
|
|
'name' => ['required', 'string', 'max:255'],
|
|
'type' => ['required', 'string', 'max:32'],
|
|
'enabled' => ['sometimes', 'boolean'],
|
|
];
|
|
}
|
|
}
|