Refactor the City, Company and their tests.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-08-16 17:47:22 +03:00
parent a4938eb099
commit c22945926c
4 changed files with 84 additions and 33 deletions
+7
View File
@@ -28,6 +28,13 @@ class Company extends Model
return $this->hasMany(Category::class);
}
public static function isExist(int $company_id): bool
{
$count = Company::where('id', $company_id)->count();
return $count != 0;
}
public static function validate_with_name(string $name)
{
$name = $name ?? '';