MohmmedAshraf / laravel-translations

Laravel Translations UI package provides a user-friendly interface for managing translations in your Laravel application. It simplifies tasks such as adding, editing, deleting, and exporting translations. The package also includes a handy search feature and the ability to invite collaborators for easy translation management
MIT License
648 stars 91 forks source link

Bugs in installation #53

Closed MomoDerDodo closed 10 months ago

MomoDerDodo commented 10 months ago

While following the install instructions i ran into a few bugs.

When i try to run the migrations i get the following error: grafik

I changed the type of the status column to string and was able to proceed.

Then after i follow the steps i get to the contributor creation. After entering the prompted data i get the the following error: grafik

MohmmedAshraf commented 10 months ago

Hi @Morice99,

I've tried installing the package on fresh Laravel multiple times, and I didn't encounter a similar issue. Could you please provide more information about your PHP version, Laravel version, and the database driver you're using?

MomoDerDodo commented 10 months ago

Hi, thanks for the reply.

My versions are:

My Database driver is the default configured mysql that looks like this:

 'mysql' => [
          'driver' => 'mysql',
          'url' => env('DATABASE_URL'),
          'host' => env('DB_HOST', '127.0.0.1'),
          'port' => env('DB_PORT', '3306'),
          'database' => env('DB_DATABASE', 'forge'),
          'username' => env('DB_USERNAME', 'forge'),
          'password' => env('DB_PASSWORD', ''),
          'unix_socket' => env('DB_SOCKET', ''),
          'charset' => 'utf8mb4',
          'collation' => 'utf8mb4_unicode_ci',
          'prefix' => '',
          'prefix_indexes' => true,
          'strict' => true,
          'engine' => null,
          'options' => extension_loaded('pdo_mysql') ? array_filter([
              PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
          ]) : [],
      ]
MomoDerDodo commented 10 months ago

Also i tried it with default and fresh laravel installation and it also fails

NoahNxT commented 10 months ago

Same issue here, seems to be an issue with the TEXT type of the status column. After some digging I found that adding a default value to a TEXT column type isn't possible out of the box, herefore you have to configure your mysql installation a specific way, and also run a version 8.0+

replacing it by the column type STRING like this: $table->string('status')->default(StatusEnum::active->value);

solves it.

Looking at the code this field is also only for the statuses which you pre-integrated. So adding a TEXT type column would be unneccesary, which make a STRING type enough.

MohmmedAshraf commented 10 months ago

Hi @MomoDerDodo,

This should be fixed by @NoahNxT here #55, please try the new release.

MomoDerDodo commented 10 months ago

The fist bug is fixed, thank you :)

But the second one with the Contributer Creation is still present for me.

Outhebox\TranslationsUI\Enums\RoleEnum::from(): Argument #1 ($value) must be of type int, string given