0

I'm using laravel sail to developing some webapp, but I want to make the laravel as the backend apis, while I want to make a new container for the frontend using react.

(I may also want to add a new container for another laravel backend as a new service...)

I've seen some answer but it were to added a new db services like mysql or redis.

is there any laravel sail command for this? or should I modify the docker-compose on my own? what's the best practice to add this new container?

  • I believe you are looking for [Laravel Breeze](https://laravel.com/docs/9.x/starter-kits). This starter kit comes with a Laravel API and can even get you started with `React`, `Vue`, and more. There is also [Laravel Jetstream](https://jetstream.laravel.com/2.x/introduction.html) which has a bit more functionality if you like decisions setup for you. – treckstar Feb 10 '23 at 06:14
  • does Breeze make a separate container? I haven't trying out Breeze and some of the feature like the `breeze:install api` will help me later on, but I still need to add a new separate container in sail... – beep beep Feb 10 '23 at 07:40
  • If by container you mean like, a whole new instance, it can. Just like you said you would install the `php artisan breeze:install api` command and then configure your routes in the `api.php` file. You could then check out the [Laravel Breeze Nextjs Starter](https://github.com/laravel/breeze-next) which I have personally used. It works well. [I have a demo of the site here.](http://breeze-next.api.aggressivecache.com). – treckstar Feb 10 '23 at 14:27

1 Answers1

0

If i understood your question correctly, you don't need to add any container to sail. Just set up a new container to serve your frontend, and consume APIs from your sail container.

  • The person who asked the original question was not clear what they really wanted. Instead of Answering, try adding a comment to them to clarify what they really want so your answer can be specific. – john Feb 17 '23 at 07:44