Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New migration syntax #23

Open
Hoopex opened this issue Sep 29, 2022 · 10 comments
Open

New migration syntax #23

Hoopex opened this issue Sep 29, 2022 · 10 comments

Comments

@Hoopex
Copy link

Hoopex commented Sep 29, 2022

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

@SiavashBamshadnia
Copy link
Owner

Which operating system are you using to develop?
Which PHP version?

@Hoopex
Copy link
Author

Hoopex commented Oct 7, 2022

Which operating system are you using to develop?
Linux (Ubuntu)

Which PHP version?
8.1

You don't have that issue ?

@SiavashBamshadnia
Copy link
Owner

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.

@Hoopex
Copy link
Author

Hoopex commented Oct 7, 2022

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 {}

@SiavashBamshadnia
Copy link
Owner

Okay, @Hoopex. Thanks for reporting this problem. I will check it.

@SiavashBamshadnia
Copy link
Owner

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.

@Hoopex
Copy link
Author

Hoopex commented Oct 22, 2022

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.

@Hoopex
Copy link
Author

Hoopex commented Oct 27, 2022

Any updates by any chance ?

@SiavashBamshadnia
Copy link
Owner

Hello.
I think phpbolt does not support anonymous classes. As a result, I created an issue in phpbolt's repository.

@jamesRUS52
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants