https://dev.to/andrewsavetchuk #service-classes%E2%80%8B Service Classes A service class is a class that performs some business logic that you want to use in various places.
Some ideas for service classes: Service class responsible for sending SMS via Twilio.
Service class responsible for connecting to UptimeRobot APIs and retrieving data.
Here is an example of the App\Services\UptimeRobotAPI.php service class that is responsible for connecting to the UptimeRobot API and retrieving data: url = 'https://api.uptimerobot.com/v2/'; $this->http = $client; $this->headers = [ 'cache-control' => 'no-cache', 'content-type' => 'application/x-www-form-urlencoded', ]; } private function getResponse (string $uri = NULL) { // Making a GET request to UptimeRobot API using GuzzleHttp... } private function postResponse (string $uri = NULL, array $params = []) { // Making a POST request to UptimeRobot API using GuzzleHttp... } public function getMonitors () { return $this->getResponse('getMonitors'); }}