encode($mt); } /** * Register callbacks */ protected static function boot() { parent::boot(); static::creating(function ($model) { if (empty($model->id)) { $model->id = static::createNewHashId(); } }); } }