Support the ongoing development of Laravel.io →
Input
Last updated 1 month ago.
0

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.

Last updated 1 month ago.
0

Thanks mate, got the idea.. Great input ;)

Last updated 1 month ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

olebulow olebulow olebulow Joined 31 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.