2022-09-30 13:56:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Migrators;
|
|
|
|
|
2022-10-07 18:58:48 +02:00
|
|
|
use Illuminate\Support\Collection;
|
2022-09-30 13:56:11 +02:00
|
|
|
|
|
|
|
abstract class Migrator
|
|
|
|
{
|
|
|
|
/**
|
2022-10-07 18:58:48 +02:00
|
|
|
* Convert migration data to a 2FAccounts collection.
|
|
|
|
*
|
|
|
|
* @param mixed $migrationPayload
|
|
|
|
* @return \Illuminate\Support\Collection The converted accounts
|
2022-09-30 13:56:11 +02:00
|
|
|
*/
|
2022-10-07 18:58:48 +02:00
|
|
|
abstract protected function migrate(mixed $migrationPayload) : Collection;
|
2022-09-30 13:56:11 +02:00
|
|
|
|
2022-10-11 11:20:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Pad a string to 8 chars min
|
|
|
|
*/
|
|
|
|
protected function padToValidBase32Secret(string $string)
|
|
|
|
{
|
|
|
|
return str_pad($string, 8, '=');
|
|
|
|
}
|
|
|
|
|
2022-09-30 13:56:11 +02:00
|
|
|
}
|