ldc-gen-game-web/app/Http/Requests/Bo/Tenants/StoreTenantRequest.php
2025-08-29 14:46:51 +02:00

49 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests\Bo\Tenants;
use App\Models\Tenant;
use App\Traits\Requests\HasPicture;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
class StoreTenantRequest extends FormRequest
{
use HasPicture;
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
return Gate::check('create', Tenant::class);
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, string>
*/
public function rules(): array
{
return [
'theme' => 'required|string|min:3|max:255|unique:tenants,theme',
'domain' => 'required|string|min:3|max:255|unique:domains,domain',
];
}
/**
* Get custom attributes for validator errors.
*
* @return array<string, string>
*/
public function attributes(): array
{
return [
'theme' => trans('validation.custom.theme'),
'domain' => trans('validation.custom.domain'),
];
}
}