Sounds like you need another class to wrap that API call in.
Create a new class and make sure it's going to be autoloaded. You might need to create a classes directory and then in your global start file add the directory to the class loader.
Economic.php
<?php
class Economic {
public function pushCustomerData()
{
// Place your API call in here
}
}
Then from within your store
method you can get an instance of the Economic class and call the pushCustomerData
method.
$economic = new Economic;
$economic->pushCustomerData();
This is just the basic idea. You might like to create a constructor on that class to simplify a few things, especially if you have a number of API calls that you make that re-use the same connection details.
Thanks mate, got the idea.. Great input ;)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community