Refactor the Company and its validator test.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-08-16 18:12:29 +03:00
parent c22945926c
commit 135f4c0c93
3 changed files with 38 additions and 3 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ class Company extends Model
return $count != 0;
}
public static function validate_with_name(string $name)
public static function validateWithName(string $name)
{
$name = $name ?? '';
@@ -44,7 +44,7 @@ class Company extends Model
'error' => 'The company name is empty, please, write the name!!!'
];
$company = company::where('name', $name)->first();
$company = Company::where('name', $name)->first();
if(!$company)
return [