This repository was archived by the owner on Nov 30, 2022. It is now read-only.
issue on running rest API in controller #940
Unanswered
sandeshpaudyal123
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@osiset
In Controller
I want to call metafields POST API on button click. The /updatemetafield route is hit and the code reaches the controller. On updatemetafield method in controller I run below code to get shop domain and password in order to create client and session but get the error "Attempt to read property "name" on null" ". Can any one help me to run the rest apis on controller.
Note: This way only works for first time when dashbaord is loading.
$shop_domain = Auth::user()->name;
$accesstoken = Auth::user()->password;
Beta Was this translation helpful? Give feedback.
All reactions