Skip to content

Commit 1dce716

Browse files
committed
Modified messages.
1 parent 4aa4224 commit 1dce716

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

src/Commands/DBConstrainCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function handle(AuditService $auditService)
9494

9595
renderUsing($this->output);
9696

97-
render('<div class="w-120 px-2 p-1 bg-green-600 text-center"> 😎 ' . __('Lang::messages.constraint.messages.success') . ' 😎 </div>');
97+
render('<div class="w-120 px-2 p-1 bg-green-600 text-center"> 😎 ' . __('Lang::messages.constraint.success_message.constraint_added') . ' 😎 </div>');
9898

9999
$this->displayTable($tableName);
100100
}
@@ -121,7 +121,7 @@ public function handle(AuditService $auditService)
121121
*/
122122
public function displayTable($tableName)
123123
{
124-
$auditService = resolve(AuditService::class);
124+
$auditService = resolve(AuditService::class);
125125

126126
$data = [
127127
"table" => $tableName,

src/Lang/en/messages.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,24 @@
1717

1818
'constraint' => [
1919
'question' => [
20-
'table_selection' => 'Which table whould you like to audit?',
21-
'continue' => 'Do you want add more constrain?',
22-
'constraint_selection' => 'Please select constrain which you want to add',
23-
'field_selection' => 'Please select field where you want to add',
20+
'table_selection' => 'Which table would you like to audit?',
21+
'continue' => 'Do you want add more constraint?',
22+
'constraint_selection' => 'Please select a constraint which you want to add',
23+
'field_selection' => 'Please select a field to add constraint',
2424
'foreign_table' => 'Please add foreign table name',
2525
'foreign_field' => 'Please add foreign table primary key name',
2626
],
27-
'messages' => [
28-
'success' => 'Constraint Add Successfully'
27+
'success_message' => [
28+
'constraint_added' => 'Constraint Added Successfully'
2929
]
3030
],
31-
3231
'standard' => [
33-
'error_messages' => [
34-
'length' => 'Names should be not more than 64 characters.',
35-
'plural' => 'Use Table Name Plural.',
36-
'space' => 'Using space between words is not advised. Please Use Underscore.',
37-
'alphabets' => 'Numbers are not for names! Please use alphabets for name.',
38-
'lowercase' => 'Use lowercase MYSQL is case sensitive.'
32+
'error_message' => [
33+
'length' => 'Table name should not be more than 64 characters.',
34+
'plural' => 'Table name should be Plural.',
35+
'space' => 'Using space between words is not advised. Please Use Underscore "_".',
36+
'alphabets' => 'Numbers are not for names and is not advised! Please use alphabets for name.',
37+
'lowercase' => 'Name should be lowercase.'
3938
]
4039
]
4140

src/Services/RuleService.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function tablesRule(): array
4545
}
4646

4747
/**
48-
* Check Status for Tables and Fields
49-
* @param string $tableName
50-
* @return string
48+
* Check Status for Tables and Fields
49+
* @param string $tableName
50+
* @return string
5151
*/
5252
public function checkStatus(string $tableName): string
5353
{
@@ -69,7 +69,7 @@ public function checkStatus(string $tableName): string
6969
/**
7070
* Get Table Size
7171
* @param string $tableName
72-
* @return string $size
72+
* @return string $size
7373
*/
7474
public function getTableSize(string $tableName)
7575
{
@@ -115,25 +115,25 @@ public function checkRules($name, $type = null): array
115115
$checkNamePlural = $this->namingRuleService->nameAlwaysPlural($name);
116116

117117
if (!$checkLength) {
118-
$messages[] = __('Lang::messages.standard.error_messages.length');
118+
$messages[] = __('Lang::messages.standard.error_message.length');
119119
}
120120

121121
if (!$checkNamePlural) {
122-
$messages[] = __('Lang::messages.standard.error_messages.plural');
122+
$messages[] = __('Lang::messages.standard.error_message.plural');
123123
}
124124
}
125125

126126
if (!$checkSpace) {
127-
$messages[] = __('Lang::messages.standard.error_messages.space');
127+
$messages[] = __('Lang::messages.standard.error_message.space');
128128
}
129129

130130
if (!$checkAlphabets) {
131-
$messages[] = __('Lang::messages.standard.error_messages.alphabets');
131+
$messages[] = __('Lang::messages.standard.error_message.alphabets');
132132
}
133133

134134

135135
if (!$checkLowerCase) {
136-
$messages[] = __('Lang::messages.standard.error_messages.lowercase');
136+
$messages[] = __('Lang::messages.standard.error_message.lowercase');
137137
}
138138
} catch (Exception $exception) {
139139
Log::error($exception->getMessage());

0 commit comments

Comments
 (0)