Laravel-Source-Encrypter
Laravel-Source-Encrypter copied to clipboard
New migration syntax
When, I try to encrypt a migration file
Old syntax
class CreateUserTableextends Migration {
}
Migration works without any issues
New syntax laravel >=8
return new class extends Migration {
};
Migration not working and returning that error Class "CreateUserTable" not found
Which operating system are you using to develop? Which PHP version?
Which operating system are you using to develop? Linux (Ubuntu)
Which PHP version? 8.1
You don't have that issue ?
Actually I don't use Ubuntu. But I think this error is not related to this package. Try running the original code (without encryption) and see if the error still exists.
I think it related to this package because the original source (without encryption) works, but encrypted source I got that error. and to make it work, I have to give manual class name to all migrations
From return new class extends Migration {};
To class CreateUserTable extends Migration {}
Okay, @Hoopex. Thanks for reporting this problem. I will check it.
Hello, @Hoopex. Sorry for the late response...
I got to install Ubuntu and check the scenario. I installed PHP 8.1 and created a Laravel project with the composer. Then, I installed the sbamtr/laravel-source-encrypter
and tried to encrypt the project. Finally, migrations were encrypted without any problem. The migrations were the default ones that those are:
https://github.com/laravel/laravel/tree/586b9e7bf5efef4d205552cc285a3f8498767578/database/migrations
I think you are using the wrong version of phpbolt.
Hi Mr @SiavashBamshadnia
- Finally, migrations were encrypted without any problem.
It's not about encryption, the issues about migrations when you try to run
php artisan migration
command.
I test that again with fresh laravel project and the I got the same result, and I can confirm that I', using the right phpbolt version.
Any updates by any chance ?
Hello. I think phpbolt does not support anonymous classes. As a result, I created an issue in phpbolt's repository.
+1