added unique validation and help text for company slug field

This commit is contained in:
asift798
2022-03-21 12:04:17 +05:30
parent 20c2502e31
commit 5c63770b6b
6 changed files with 9 additions and 2 deletions

View File

@ -34,7 +34,8 @@ class CompaniesRequest extends FormRequest
'required'
],
'slug' => [
'required'
'required',
Rule::unique('companies')
],
'address.name' => [
'nullable',

View File

@ -30,7 +30,8 @@ class CompanyRequest extends FormRequest
Rule::unique('companies')->ignore($this->header('company'), 'id'),
],
'slug' => [
'nullable'
'required',
Rule::unique('companies')->ignore($this->header('company'), 'id'),
],
'address.country_id' => [
'required',

View File

@ -50,6 +50,7 @@
<BaseInputGroup
:label="$tc('settings.company_info.company_slug')"
:help-text="$t('settings.company_info.company_slug_help_text')"
:error="
v$.newCompanyForm.slug.$error &&
v$.newCompanyForm.slug.$errors[0].$message

View File

@ -36,6 +36,7 @@
<BaseInputGroup
:label="$tc('wizard.company_slug')"
:help-text="$t('wizard.company_slug_help_text')"
:error="
v$.companyForm.slug.$error &&
v$.companyForm.slug.$errors[0].$message

View File

@ -30,6 +30,7 @@
<BaseInputGroup
:label="$tc('settings.company_info.company_slug')"
:help-text="$t('settings.company_info.company_slug_help_text')"
:error="v$.slug.$error && v$.slug.$errors[0].$message"
required
>

View File

@ -864,6 +864,7 @@
"company_info": "Company info",
"company_name": "Company Name",
"company_slug": "Company Slug",
"company_slug_help_text": "A unique URL friendly name for your company. It will be used for the URL of your Customer Portal.",
"company_logo": "Company Logo",
"section_description": "Information about your company that will be displayed on invoices, estimates and other documents created by Crater.",
"phone": "Phone",
@ -1326,6 +1327,7 @@
"company_info_desc": "This information will be displayed on invoices. Note that you can edit this later on settings page.",
"company_name": "Company Name",
"company_slug": "Company Slug",
"company_slug_help_text": "A unique URL friendly name for your company. It will be used for the URL of your Customer Portal.",
"company_logo": "Company Logo",
"logo_preview": "Logo Preview",
"preferences": "Company Preferences",