user() !== null; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'name' => ['required', 'string', 'max:255'], 'slug' => ['nullable', 'string', 'max:255', Rule::unique(Workspace::class)], 'user_ids' => ['array'], 'user_ids.*' => ['integer', 'exists:users,id'], 'user_roles' => ['nullable', 'array'], 'user_roles.*' => ['string', 'in:'.implode(',', WorkspaceUserRole::getValues())], ]; } }