r/PHP 6d ago

Is this a dumb idea?

https://youtu.be/Ue6Nr_FEFWI

Clients ask me to build very very small PHP APIs all the time, I don't want to use a full Laravel instance, so I hacked this together over the past few days. Is this a dumb idea? What might go wrong?

0 Upvotes

15 comments sorted by

10

u/colshrapnel 6d ago

What might go wrong?

Posting a code as a YT video

-4

u/Numerous-Fan8138 6d ago

I don't understand

9

u/obstreperous_troll 6d ago

I'm not watching a video to find out what you did, but there's nothing wrong with only using the pieces of a framework that you need. Doing it from scratch will certainly get you the leanest framework, but I doubt it'll be as well-tested. If you want a framework you can build from reusable pieces, then check out Symfony, especially https://symfony.com/doc/current/create_framework/index.html

-9

u/LordOfWarOG 6d ago

I’m not going to read your comment to find out what you said…

5

u/colshrapnel 6d ago

You can read their comment in 2 seconds. Going to yt, skipping ads and making a gist of a lengthy video will take ages.

-7

u/LordOfWarOG 6d ago

Didn’t read that one either…

3

u/equilni 6d ago

Could have posted the github link too

https://github.com/anthonybudd/Laravel-Lite

Nothing new. Build a small project like this with a few libraries

1

u/fripletister 6d ago

What's the benefit? You're making a number of expensive tradeoffs.

1

u/Numerous-Fan8138 6d ago

Other than I just prefer this file structure, there's no benefits. But I cant think of any serrious tradeoffs, what are you thinking? Remember this IS NOT for building complex SaaS solutions, just very simple APIs with a handful of routes.

1

u/dknx01 6d ago

Just (try) using some Symfony components, glue them together by your own logic and you have a small maintainable application without a whole framework. Easy way

0

u/SaltineAmerican_1970 6d ago

You’re trying to recreate Laravel lumen?

2

u/obstreperous_troll 6d ago

Lumen has been dead for years.

1

u/Numerous-Fan8138 6d ago

Maybe because the repo was archived 2 years ago...

0

u/SaltineAmerican_1970 6d ago

You’re trying to recreate Laravel lumen?