glembo's avatar

Where to place own socket logic for data transfer between laravel and custom software

Hi, I started working on a laravel based system for some ecommerce stuff. Actually I have the problem that all the data I gonna use is stored in our company's own system. We developed a socket api for data exchange with json.

All the things we want to do are prepared within the socket system. E.g:

  • get all products
  • get specific product information
  • send transaction details
  • send cart details
  • get product stock
  • send / get user data

My problem is the implementation in laravel. I plan different cli routes and configured some in command / routes.

I have several questions regarding this topic:

  1. Where can I create a class and folder for these purpose? Is the right place the app directory or subsequent folders?

  2. The tasks should get processed every 5 minutes. I plan to use the laravel task sheduler for this. I plan to create a resource controller for the socket communication triggered from the cmd routes. How can I implement the data logic for these system? Just create a class like a model and configure the code there or is it better do create a whole package for this?

I hope the question is understandable. If you need more details please ask for it. I'll try my best to deliver more specific information.

Kind regards Florian

0 likes
0 replies

Please or to participate in this conversation.