Support the ongoing development of Laravel.io →
posted 10 years ago
Input
Last updated 2 years 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 2 years ago.
0

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

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

olebulow olebulow Joined 31 Jan 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.