News for hackers. Stuff that matters.
Re:Laravel 9 by jackconsidine on Tuesday February 08, 2022 @01:01PM (#30261949)
For those here wondering why you'd use Laravel over vanilla PHP + MySQL + PDO, a few of my clients had this opinion so I've had experience. The Laravel "fluff" saves you from rewriting tons of code, helps you write test cases, and makes logic easy to follow.

One of my clients was very anti "needless vendor packages" (definitely some truth to this sentiment), but we ended up with 14 extra php files reinventing the wheel. I'd opt for the former any day.

Re:Laravel 9 by pluc on Tuesday February 08, 2022 @01:27PM (#30262365)
The concept of frameworks in PHP predates its package manager and its PSR standards. Nowadays you can easily slap a collection of libraries together to create your own micro-framework that fulfills your precise needs. That is often a better decision than to go with a monster like Laravel or Symfony which by design aims to be good at all the things, instead of good at the things you need. Those frameworks themselves usually have individual components that can be used independently of the rest of the framework for exactly this purpose
Re:Laravel 9 by n42 on Tuesday February 08, 2022 @01:41PM (#30262549)
hello, I am in a growth phase startup and have been here since the early days. I am speaking from experience about a specific type of company and codebase.

if you’re planning to scale a team and a company, do not do this. stick to Laravel. let your new hires read the docs and move on to shipping features.

if I were going to build a solo project, yes, I would consider bolting the libraries I want into a high comfort codebase that allowed me to move quickly.

there is a massive Laravel talent pool and straying from the standard approach just makes onboarding and maintenance more difficult. focus on your company’s problems and don’t be bespoke. if Laravel is even in consideration for you and your company and your problem space, there’s absolutely no problem that is worth reinventing the wheel on here

Re:Laravel 9 by tomschlick on Tuesday February 08, 2022 @01:39PM (#30262527)
The biggest benifit to something like Laravel is that a new developer to your team can step in and know where everything should be and how it should generally work without asking. There is good documentation so you dont have to write that for your foundational code, just your business logic.

A bunch of bespoke packages strung together with no logic does not provide that. You can surely look up how one package works but its a lot harder to figure out how it all ties together.

Re:Laravel 9 by pluc on Tuesday February 08, 2022 @02:08PM (#30262961)
I can see how it's seen as a benefit, but the flipside is that you're teaching your developers Laravel, not PHP. They assume whatever they do, they do in a good way because it's Laravel that does it which is great, but it abstracts actual knowledge. It's like if a developer uses SQL exclusively through an ORM and DBAL, how much can they be expected to know about the workings of SQL performance, indexes, etc.

I also find it very interesting that there's no stigma associated with "Laravel developers" that focus exclusively on that framework and its syntax and way of doing things and you have "WordPress developers" who do the exact same but are seen as incompetent.

I understand though that there are scenarios in which what you want is a guy that knows a framework really well, but if we're talking about skills of a developer, I'll pick the guy that knows vanilla PHP over a framework specialist 80% of the time

Re:Laravel 9 by cutler on Tuesday February 08, 2022 @06:56PM (#30266598)
I find it hard to imagine how anyone who groks Laravel well enough to get a product shipped could be deficient in understanding PHP. Surely such cases are outliers?
Re:Laravel 9 by kyriakos on Thursday February 10, 2022 @11:45PM (#30297096)
I regularly interview PHP developers for hiring and I can quickly classify them into 1. Wordpress Developers, 2. PHP developers and lately 3. Laravel developers.

Specifically for no 3 is the kind of developer who considers the framework magical and has no idea how things are done without it because they've learned framework first and the PHP basics to survive. They can do well for basic CRUD tasks but for anything trickier they get stuck.

Re:Laravel 9 by 1123581321 on Friday February 18, 2022 @12:18PM (#30388421)
Seems easy enough to teach if those developers have picked up whatever is in front of them in the past.
Re:Laravel 9 by tomschlick on Tuesday February 08, 2022 @03:31PM (#30264213)
Being Laravel focused and knowing what is happening underneath the hood are not mutually exclusive. A mature developer knows when to stray from the framework when its absolutely needed, not when it just seems like a fun thing to do. 99% of the time the frameworks predetermined path is the right way as its the simplest to maintain.
Re:Laravel 9 by munk-a on Tuesday February 08, 2022 @01:44PM (#30262588)
I think this is a benefit from using a framework in general and there are some good alternatives in the PHP space.
Re:Laravel 9 by yurishimo on Tuesday February 08, 2022 @01:55PM (#30262768)
One of the nice things about Laravel, is that in a lot of ways it extends the functionality of Symfony and uses many of it's packages under the hood.
Re:Laravel 9 by jonwinstanley on Tuesday February 08, 2022 @03:12PM (#30263922)
If you’re pulling libraries instead of using a framework, you’re basically just writing your own framework. One that’s simpler but also it’s unique so you lose the ability to bring in a seasoned Laravel dev that can get going right away. You have introduced a learning curve for all new devs that didn’t need to be there.
Re:Laravel 9 by mechanical_bear on Tuesday February 08, 2022 @01:55PM (#30262760)
There is a micro symfony build just for this purpose, as barebones as possible, pull in only what you need.
Re:Laravel 9 by dragosmocrii on Tuesday February 08, 2022 @01:07PM (#30262031)
yes, that's basically what a framework is for. but you have to follow the framework's way of doing things. most of the time that works well. few times, you may be fighting the framework to achieve some special cases.

you call libraries. framework calls you.

Re:Laravel 9 by jackconsidine on Tuesday February 08, 2022 @02:47PM (#30263566)
Yeah you're right this is kind of the archetypical "framework vs not" or "framework vs library" debate.

And I agree there's nuance to that conversation.

IMO, PHP codebases most err on the side of "reinventing the wheel" because PHP has since its inception just sort of worked, i.e. mirroring directory structure, spitting out HTML verbatim etc. So the framework luddites tend to be over-represented with PHP projects. Hence my opinion here.

Re:Laravel 9 by munk-a on Tuesday February 08, 2022 @01:43PM (#30262576)
I would say that if you're considering frameworkless I might suggest Laminas (the Zend successor) as an alternative since it allows you to pull in tools in a more piecemeal style. Integrating roll-your-own components into Laravel can be difficult due to have tightly knit and off the beaten path their internal style can be.

I think there are a few quite good choices of frameworks right now in PHP and I hope the space remains healthy and varied since the different options do cater well to different use cases.

Re:Laravel 9 by PetahNZ on Tuesday February 08, 2022 @01:45PM (#30262607)
14 files on the scale of a large app, is nothing?
Re:Laravel 9 by jackconsidine on Tuesday February 08, 2022 @02:25PM (#30263230)
Yeah, not a large app. I should have mentioned that it had like 12 endpoints total