2FAuth/app/Services/Migrators/Migrator.php

26 lines
583 B
PHP
Raw Normal View History

<?php
namespace App\Services\Migrators;
use Illuminate\Support\Collection;
abstract class Migrator
{
/**
* Convert migration data to a 2FAccounts collection.
*
2022-11-21 11:16:43 +01:00
* @return \Illuminate\Support\Collection<int|string, \App\Models\TwoFAccount> The converted accounts
*/
abstract public function migrate(mixed $migrationPayload) : Collection;
/**
* Pad a string to 8 chars min
2022-11-22 15:15:52 +01:00
*
* @return string The padded string
*/
protected function padToValidBase32Secret(string $string)
{
return str_pad($string, 8, '=');
}
}