user() !== null; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { $storeId = $this->route('store')?->id ?? $this->route('store'); return [ 'name' => ['required', 'string', 'max:160'], 'description' => ['nullable', 'string', 'max:2000'], 'type' => ['required', 'string', 'max:60'], 'owner_id' => ['nullable', 'integer', Rule::exists('users', 'id')], 'agent_id' => ['nullable', 'integer', Rule::exists('ai_agents', 'id')], 'pos_x' => ['required', 'numeric', 'between:-100000,100000'], 'pos_y' => ['required', 'numeric', 'between:-100000,100000'], 'pos_z' => ['required', 'numeric', 'between:-100000,100000'], 'width' => ['nullable', 'numeric', 'min:0.1', 'max:1000'], 'height' => ['nullable', 'numeric', 'min:0.1', 'max:1000'], 'depth' => ['nullable', 'numeric', 'min:0.1', 'max:1000'], 'is_open' => ['nullable', 'boolean'], ]; } }