mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-30 04:03:18 +01:00
28 lines
654 B
PHP
28 lines
654 B
PHP
<?php
|
|
|
|
namespace App\Services\Migrators;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
abstract class Migrator
|
|
{
|
|
/**
|
|
* Convert migration data to a 2FAccounts collection.
|
|
*
|
|
* @param mixed $migrationPayload
|
|
* @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
|
|
*
|
|
* @param string $string
|
|
* @return string The padded string
|
|
*/
|
|
protected function padToValidBase32Secret(string $string)
|
|
{
|
|
return str_pad($string, 8, '=');
|
|
}
|
|
}
|