add separate flight_fields table and move over to flight_field_values
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models\Traits;
|
||||
|
||||
use App\Interfaces\Model;
|
||||
use Hashids\Hashids;
|
||||
|
||||
trait HashIdTrait
|
||||
@@ -10,11 +11,10 @@ trait HashIdTrait
|
||||
* @return string
|
||||
* @throws \Hashids\HashidsException
|
||||
*/
|
||||
protected static function createNewHashId(): string
|
||||
final protected static function createNewHashId(): string
|
||||
{
|
||||
$hashids = new Hashids('', 12);
|
||||
$hashids = new Hashids('', Model::ID_MAX_LENGTH);
|
||||
$mt = str_replace('.', '', microtime(true));
|
||||
|
||||
return $hashids->encode($mt);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ trait HashIdTrait
|
||||
* Register callbacks
|
||||
* @throws \Hashids\HashidsException
|
||||
*/
|
||||
protected static function bootHashIdTrait()
|
||||
final protected static function bootHashIdTrait(): void
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
if (empty($model->id)) {
|
||||
|
||||
Reference in New Issue
Block a user