A possible workaround is to shorten the table name in AppServiceProvider before run the migration:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
\Laragear\WebAuthn\Models\WebAuthnCredential::$useTable = 'webauthn';
}
}
However, this is not so elegant. The max length also applies to MySQL or PostgreSQL.
PHP & Platform
8.3.3 - Linux aarch64
Database
MariaDB 11.3.2
Laravel version
10.48.3
Have you done this?
Expectation
Migrate
create_webauthn_credentials
Description
Table index names have a maximum length of 64 characters. The relevant generated index name is 66 characters long:
webauthn_credentials_authenticatable_type_authenticatable_id_index
Maybe this is more of an issue for laragear/meta-model
https://github.com/Laragear/WebAuthn/blob/c75a373143f226e6914301229e512905766099e3/src/Migrations/WebAuthnAuthenticationMigration.php#L21
A possible workaround is to shorten the table name in
AppServiceProvider
before run the migration:However, this is not so elegant. The max length also applies to MySQL or PostgreSQL.
Reproduction
Stack trace & logs