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

Access model properties in ActionJob #81

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

ejntaylor
Copy link
Contributor

@ejntaylor ejntaylor commented Aug 23, 2022

This resolves the issue identified in #76

In our QueueableAction class we could have:

public int $timeout = 240

Currently when using ActionJob we get:

PHP Warning: Attempt to read property "timeout" on string in /Users/me/dev/example-laravel/vendor/spatie/laravel-queueable-action/src/ActionJob.php on line 151

This PR fix will now return 240 whereas it previously returned the warning.

The $action variable is a string of the action ClassName, so we cannot access the $queueableProperty unless we first new up the class. Using the app() helper for this.

@freekmurze freekmurze merged commit 01da21e into spatie:main Aug 23, 2022
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants