0

I have model tracking and method getTarcking with return is response from API, i want call those response from controller and parsing to view

I my controller create index method

$Mrespone = $this->Tracking->getTracking();

return view('tracking/index'['respon'=>$Mrespone]);

But, In controller I got error

2
  • Can you add more code please. Commented Aug 2, 2019 at 4:06
  • Also, provide the error that you get. Commented Aug 2, 2019 at 4:19

2 Answers 2

1

You forgot a comma(,). Try dd($Mrespone) just to be sure whether you are getting a response or not.

$Mrespone = $this->Tracking->getTracking();

return view('tracking/index',['respon'=>$Mrespone]);
Sign up to request clarification or add additional context in comments.

Comments

0

first debug whether you getTracking() is getting response or not.

dd($Mrespone)

if data is showing then comment dd() and for view you can do like this

return view('tracking/index')->with('respon', $Mrespone);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.