feat: Reimplement order and invoice management with new service and repository layers, introduce compression middleware, and update database schema.
This commit is contained in:
@@ -437,11 +437,11 @@ class Helper
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function generateUniqueCode(): int
|
||||
public static function generateUniqueCode(): string
|
||||
{
|
||||
do {
|
||||
$code = random_int(1000000, 99999999);
|
||||
} while (Order::where("order_num", "=", $code)->first());
|
||||
$code = 'ORD-' . strtoupper(\Illuminate\Support\Str::random(8));
|
||||
} while (Order::where('order_num', $code)->exists());
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user