laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

[Proposal] Api only project #2398

Open wasimkabir opened 3 years ago

wasimkabir commented 3 years ago

This is a feature request (proposal).

It would be better to have an "api-only" flag for generating a new project and removing the extra bloats that are not needed for api only project.

Also, may be an option to choose sanctum or passport as a driver.

This kind of flag is provided by a nodejs framework AdonisJs, which is inspired by Laravel.

mfn commented 3 years ago

I loathe to mention this, but there is https://lumen.laravel.com/

wasimkabir commented 3 years ago

I loathe to mention this, but there is https://lumen.laravel.com/

Yeah Lumen is good but many things that I love about laravel are missing in lumen, one of them is artisan console, if I'm not wrong.

Sladewill commented 3 years ago

I think you can pull other laravel packages into lumen but its cumbersome and won't necessarily always work right away without adjustments.

mfn commented 3 years ago

Ack, and it just creates headaches for packages because, compared to writing/maintaining one for Laravel, there's no proper test infrastructure for Lumen.

That said, years ago I started out with L5 for an "API only" project, and indeed: we threw out everything we could we didn't needed (sessions, etc.) and it was definitely sufficient.

Fast-forward a few years later: this project evolved, needed queues and turned out to be "more than just API only" and boi, was I glad I did not use Lumen because gradually we added more stuff back as we went ahead.

Sladewill commented 3 years ago

That's also how we mostly operate, however they are some things in Laravel that are baked in such as the Auth system that could do with abstracting into the auth package they have.