First Touch

Laravel Microservices- Breaking A Monolith To M... -

In order-service :

return response($response->body(), $response->status()); In a monolith, you had foreign keys like user_id in the orders table. Now, user_id exists only in Auth DB. In Order DB, you store auth_user_id as a string (UUID) , not a foreign key. Laravel Microservices- Breaking a Monolith to M...

return response()->json(['token' => $token]); In order-service : return response($response-&gt

version: '3.8' services: auth-service: build: ./auth-service environment: DB_HOST: mysql_auth JWT_SECRET: $JWT_SECRET ports: - "8001:8000" catalog-service: build: ./catalog-service environment: DB_HOST: mongodb ports: - "8002:8000" In a monolith

composer create-project laravel/laravel auth-service composer create-project laravel/laravel catalog-service composer create-project laravel/laravel order-service In the monolith, you used Auth::user() . In microservices, you cannot query another service's database.

Scroll to Top