Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dealense's avatar

where should I make crud (WEB vs API)?

When I learn laravel that was on v5.8. So I found one tutorials on Youtube and that guy was making Crud Routes in routes/web. Today many of you use api. So I want to know, should I make crud in routes/api or in routes/web and in which cases. thank you!

0 likes
1 reply
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

If you use Blade ( in the same project, same Laravel App ) then you usually put routes in web.php

If you create e separate application, could be Vue app, React App, Angular, Android App, iOS app, then you place in api.php, for external api - the same thing, put the routes in api.php

Please or to participate in this conversation.