add separate flight_fields table and move over to flight_field_values

This commit is contained in:
Nabeel Shahzad
2018-03-20 13:06:06 -05:00
parent a9454c319a
commit 485c6e86bb
17 changed files with 147 additions and 45 deletions

View File

@@ -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)) {