laravel-shopify
laravel-shopify copied to clipboard
about WebhookController.php line 27
For bug reporting only! If you're posting a feature request or discussion, please ignore.
Expected Behavior
$jobData = json_decode($request->getContent(),true);
Current Behavior
current: $jobData = json_decode($request->getContent());
Context
如果不直接转化成数组,后期在job里调用非常麻烦。为什么不直接让他转化成数组呢?
I am not sure what you're asking or what your issue is, can you explain?
I am not sure what you're asking or what your issue is, can you explain?
eg.xxxJob.php:
`public function __construct($shopDomain, $data) { $this->shopDomain = $shopDomain; //this $data is stdclass not a array $this->data = $data; }
public function handle() { //if like this use is error.you must invert to array by stdclass $this->data['orders']['edgs']['id'];
$user = User::where('name', $this->shopDomain)->firstOrFail(); // do stuff here } `
I am sorry. I am English is very poor
Write your issue in your native language, and Google Translate it to English, might help.
On Fri., Aug. 6, 2021, 11:50 peking2008, @.***> wrote:
I am sorry. I am English is very poor
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osiset/laravel-shopify/issues/930#issuecomment-894295047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASO4ORLJJGYB2KQVLOETADT3PVR7ANCNFSM5BVDN4UA .
I think he wants $data to be an array instead of an stdClass by default.
I think he wants $data to be an array instead of an stdClass by default.
Yes,you are right!
to be honest I kinda agree with him, I always need to encode and decode so I can log the received information properly. But thats up to the author
As this is not an issue and it is quite old, going to close it.