Live data from Hacker News

Laravel 9

laravel-news.com

51–60 of 262 posts

Re: Laravel 9

#51
post #19

I like using plain PHP + PDO MySQL. I structure it so almost all files contain a single function/MySQL query, with very little dependencies. I already know how to implement core functionalities when needed (e.g. CSRF, user permissions). Why should I consider Laravel if plain PHP seems to work excellent in my case (been able to maintain the same codebase for over 9 years without issues, can quickly create a new app if…

For me, its about the higher level things included. I don't want to write a queue, event system, or cache layer again.

That makes sense, there are probably some more complex use-cases, but for those I would personally not use PHP (e.g. if real-time communication is required or linking together many microservices and having to do operations that involve more than a database and file system).

Re: Laravel 9

#52
post #19

I like using plain PHP + PDO MySQL. I structure it so almost all files contain a single function/MySQL query, with very little dependencies. I already know how to implement core functionalities when needed (e.g. CSRF, user permissions). Why should I consider Laravel if plain PHP seems to work excellent in my case (been able to maintain the same codebase for over 9 years without issues, can quickly create a new app if…

Frameworks are useful for working in teams, and on long term projects. This is because they provide a set of idioms, patterns and decisions that everyone can learn and know, without having to invent them all yourself. It doesn't have to be the perfect way, it just has to be a way, so that you can focus on your domain specfic problems.

Likewise, when a new developer arrives, they know exactly where to find everything because it has a place that it belongs, and they can reference the docs if they are having trouble.

It's less about the code and more about treating the project as a whole ecosystem.

Re: Laravel 9

#53
post #41
post #10

Laravel and Drupal 7+ frankly ruined PHP for me. PHP as a platform is KISS and elegant, and I still admire some of its features such as built in templating, filesystem based routing, etc. But whenever I look back at Laravel, I remember how dangerous overly complex fluff with a nice logo is to a platform.

IMHO Laravel and Symfony are the best things that happened to PHP community since php5. PHP was an ugly mess of bad practices, fragmented into many outdated apps/frameworks and it was just exhausting to use. Symphony was a great improvement, but a bit too rigid and too enterprise-level for my taste. For me Laravel was honestly a breath of fresh air - finally I had something significantly more powerful than my custom…

Laravel definitely is everything, but light-weight. It's the slowest of the large names in PHP.

see http://www.phpbenchmarks.com/en/comparator/framework or https://www.techempower.com/benchmarks/#section=data-r20&hw=...

Re: Laravel 9

#54

Earlier quoted context omitted.

Any app without a framework ends up creating a framework of its own. Complexity isn't something to hand-wave away, but neither is the mess of include's and SQL injection risks that many "vanilla" apps become.

Same applies for frameworks. Your hoping that the framework and ecosystem is clean as to get everyone to update the framework isn't an easy task espcially when a vulnerability arises from within. It's moot. Take Wordpress for example.

> However your then hoping that there are not any vulnerabilities within the framework.

The likelihood of me introducing an injection, authentication/authorization bypass or RCE vulnerability in homegrown stuff is orders of magnitude larger than in an application where at least the sensitive core parts are handled by something that's battle tested in millions of deployments and regularly audited.

Re: Laravel 9

#55
post #2

I've been programming in PHP for around 5 years. I've used vanilla PHP, full featured MVC frameworks, micro frameworks and I've been working with Laravel for around 2 weeks. Worst experience ever. The more I dig into it the more I hate it.

This is my experience with Laravel as well. Laravel looks great on the surface for a simple CRUD application, but once you need to do something non-trivial with it, you need to start fighting the framework. Also I dislike the large amount of magic happening within the framework. I want to understand what the code is doing, so that I can properly debug it in an emergency. As a specific example I needed to override hal…

Exactly this for the exact same reasons, only more specific to the Eloquent ORM instead. God forbid you need to do nested-nested-nested relationships or something relatively complex. Laravel works VERY well for the simple cases, but all the weak typing, reflection and runtime searches that it uses just makes every runtime framework problem a pain in the ass to debug. I'll stick to Spring Boot or ASP.NET Core any day.

Re: Laravel 9

#56
post #12
post #10

Laravel and Drupal 7+ frankly ruined PHP for me. PHP as a platform is KISS and elegant, and I still admire some of its features such as built in templating, filesystem based routing, etc. But whenever I look back at Laravel, I remember how dangerous overly complex fluff with a nice logo is to a platform.

You can use Laravel just for the basic wiring, integrated tooling, SQL query builder, auth, sessions, and HTTP routing. It really gets out of the way if you need to avoid features you don't like. All of the stuff I listed above are a PITA in plain PHP.

Yep -- Laravel has always been the work of grownups in this regard.

It's a really very good platform for headless PHP. The job queuing stuff is so neat it actually makes me write queueable jobs.

Combined with Lighthouse, Spatie's Stripe Webhooks library, Spatie's MediaLibrary, I've actually had fun with Laravel.

I see no reason for hate now.

Re: Laravel 9

#57
I've used Laravel on and off. But I always run into uncertainties when doing large refactorings. How are you doing large refactorings?

Re: Laravel 9

#58
post #47

Earlier quoted context omitted.

For me, its about the higher level things included. I don't want to write a queue, event system, or cache layer again.

Though for a small-ish site (say <150 users), such techniques are typically not necessary.

The PHP apps that I have created handle millions of monthly users without issues, so I would say that probably specific techniques are needed more to implement a given functionality instead of to achieve a better performance.

Re: Laravel 9

#59

Could somebody say, if you are planning to embark on a new Laravel project and you have no experience, how to begin? I bought a subscription to Laracasts, and there is a "What's New in Laravel 9" series. But "Laravel from Scratch" is still on 8.

Go with the "Laravel from Scratch" on v8 to learn the basics. Then follow up with the "What's new in Laravel 9". I'll be updating to v9 this spring. Laravel has been pretty stable since they changed to semver for versioning (ie v6). The framework is fairly stable. They held off the v9 release so it could have the new Symphony components. A lot of features that would have been released with v9 were added to the v8 fra…

Yep -- I am more worried about the PHP side because there you run into the question of whether other PHP devs whose packages you use are as good as the Laravel guys.

Re: Laravel 9

#60

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 whe…

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
Post reply on HN