13 lines
280 B
PHP
13 lines
280 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class UuidService extends ServiceProvider {
|
|
public function is_valid(string $uuid) {
|
|
$regex = '/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i';
|
|
return preg_match($regex, $uuid) === 1;
|
|
}
|
|
}
|