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

\Illuminate\Database\Eloquent\Concerns\PreventsCircularRecursion use \Illuminate\Support\Onceable who has a laravel dependency #52828

Closed
alepieser opened this issue Sep 17, 2024 · 7 comments

Comments

@alepieser
Copy link

Laravel Version

11.22.0

PHP Version

8.3.0

Database Driver & Version

No response

Description

Hello,

On different projects, we are using eloquent as standalone package.
Everything was working well since the release v11.22.0.

In this release, a refactoring was done and introduce a new trait Eloquent/Concerns/PreventsCircularRecursion.php.
This trait is using the class Onceable from package Support

$onceable = Onceable::tryFromTrace($trace, $callback);

The class Onceable is using use \Laravel\SerializableClosure\Support\ReflectionClosure.
As we don't have laravel as dependency, we cannot upgrade illuminate/database depdendency.

Do you think that there is a chance to solve this issue ?

Sorry if I didn't write at the right place to report this issue.

Thanks

Steps To Reproduce

You can take look on line 6 file of Onceable.php

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@crynobone
Copy link
Member

Shouldn't you be able to just run composer require "laravel/serializable-closure:^1.3"?

@alepieser
Copy link
Author

Thanks for your reply. I didn't know it was a standalone package.
I just tested and it solved the issue.

However, what do you think about to update the requirement of illuminate/support to include it ?

@crynobone
Copy link
Member

It is already suggested in illuminate/support: https://packagist.org/packages/illuminate/support

@alepieser
Copy link
Author

Ah ok ! Sorry I didn't check that.

What about this time to add it in illuminate/database ? Because it's this package who is using the once function

@samlev
Copy link
Contributor

samlev commented Sep 20, 2024

I'm responsible for PreventsCircularRecursion, but I've just now published a PR that deprecates it: #52865

@crynobone
Copy link
Member

Marking this issue as close, the package is already suggested in support and will be suggested in databaae coming next release

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