News for hackers. Stuff that matters.
Re:PHP in 2019 by cntainer on Wednesday May 15, 2019 @06:59AM (#19918163)
Agreed, Laravel provides the best dev experience in the PHP world.

The funny thing is that Laravel basically took the Ruby on Rails philosophy and applied it to PHP. Just looking at their site it's clear they have a very similar vision: simple, fast and fun. One can always find differences but the basic principles are the same.

IMO this is great kudos to the Laravel guys, whatever language I use I always look for the tooling that follows the KISS principle. In PHP you have Laravel, in Java/SCala you have PLay, etc.

I need to add that, because of the job, I did a lot of PHP, Ruby, Java, Javascript with many different frameworks and I can say that Rails is still the best for me when it comes to dev experience if you need to move fast. Laravel has come a long way but it's still not at the same level of maturity in terms of tooling and ecosystem. As a bonus with Rails you use Ruby which is designed for programmer productivity and fun.

Anyway, whatever language/framework you use just keep it simple, that's the most important decision you can make for the health of your project.

Re:PHP in 2019 by EGreg on Wednesday May 15, 2019 @01:52PM (#19921954)
It's funny, I remember when I started working on my first PHP framework, I knew about Drupal, CodeIgniter, Kohana, Symfony and Ruby on Rails. Back then, Symfony was the Ruby on Rails applied to PHP. And I wanted to have a more "php-like" approach to everything. That's when I made phponpie.com (the early attempt).

Fast forward to now. After 10 years there is https://qbix.com/platform . If you're reading this and know PHP / LAMP, I would encourage people here to try it and give me feedback. I've never really spent time growing the community or popularizing it like Laravel. But at every turn, it's made decisions that are as close to PHP and standards as possible.

In particular, the Db module may be better than Doctrine, for example.

Re:PHP in 2019 by at-fates-hands on Wednesday May 15, 2019 @04:31PM (#19923447)
> I knew about Drupal, CodeIgniter, Kohana, Symfony and Ruby on Rails.

I was a huge fan of PyroCMS which was based on Code Igniter. I stopped using it when the all of the JS frameworks exploded. I went back last year to check on them and found out they moved to Laravel.

https://pyrocms.com/

The community since then has grown by leaps and bounds. Good to see the Pyro team still out there making a great CMS.

Re:PHP in 2019 by beezischillin on Wednesday May 15, 2019 @06:39PM (#19924486)
I used both Laravel and Symfony but I ended up with the second. I didn’t like the way Laravel’s ORM has its models structured plus the Symfony PHPStorm plugin is a miracle. Your mileage may vary and this is just me but I never quite understood why people ended up loving Laravel so much vs. Symfony.
Re:PHP in 2019 by acomjean on Wednesday May 15, 2019 @09:56PM (#19925508)
I used Silex (the symphony micro framework which was merged back into Symfony), which means I'm now using Symfony. I too prefer it to Laravel. I thinks less opinionated maybe?

honestly its ok to have a different opinion, different people prefer different things.

Re:PHP in 2019 by Aeolun on Wednesday May 15, 2019 @10:19PM (#19925610)
I feel Laravel is fantastic for Junior and medior programmers, while Symfony appeals more to seniors.
Re:PHP in 2019 by jv22222 on Wednesday May 15, 2019 @11:24PM (#19925894)
I’m a senior programmer and love Laravel. But maybe I’m a junior at heart ;)
Re:PHP in 2019 by exclusiv on Thursday May 16, 2019 @11:48PM (#19936085)
All the worst projects I've inherited and rescued were Symfony. Developed by senior devs that overengineered. I'm sure newer Symfony is better and there's some good stuff out there but as a decade+ senior engineer I like Symfony components but not the framework. Love Laravel and Lumen and also some of the other microframeworks for some things. Enjoying Laravel Nova right now too.
Re:PHP in 2019 by matt_wohler on Friday May 24, 2019 @09:50AM (#20001423)
Perfectly encompasses my experience with it as well. The community of Laravel-focused developers is extremely proactive in sharing best practices and very much encourages simplicity.
Re:PHP in 2019 by brightball on Wednesday May 15, 2019 @07:17AM (#19918272)
Yep. Laravel is basically PHP on Rails. They do a great job with it too.
Re:PHP in 2019 by toastal on Wednesday May 15, 2019 @08:15AM (#19918625)
I dunno... Their home page looks like something out of the Panera Bread playbook looking at the homepage. 'Web artisans'? Why is it 'clean' because it has an absurd amount of whitespace and comments of platitudes for the code example?
Re:PHP in 2019 by mmccaff on Wednesday May 15, 2019 @10:21AM (#19919630)
"Clever" "marketing" language like this is not unique to Laravel, most frameworks use language like it for tag-lines on their homepage. Pyramid, a framework for Python, even goes with the same "artisan" language. They're just trying to be fun, inspiring, etc

From the home page of a few other frameworks:

Django: "The web framework for perfectionists with deadlines."

Flask: "Web development, one drop at a time"

Express: "Fast, unopinionated, minimalist web framework for Node.js"

Pyramid: "You need a Python web framework that supports your decisions, by artisans for artisans."

Why is it clean? Build an application with Laravel and you'll find out. :) The documentation and community are excellent. I've used many frameworks across many different languages, and (imo) it really is very nice to work in.

It's funny how the most negativity comes from people with very little experience, or at least recent experience, in the thing that they don't like.

Re:PHP in 2019 by thanatropism on Wednesday May 15, 2019 @02:21PM (#19922209)
It’s not funny. People who have bought in something have (1) to rationalize their choice and (2) cheer so the project remains alive and a major contender.
Re:PHP in 2019 by chc on Wednesday May 15, 2019 @03:20PM (#19922758)
That's not my experience at all. Most developers I know have worked with technologies before and come out saying, "I would rather use something else next time."
Re:PHP in 2019 by maw on Wednesday May 15, 2019 @05:32PM (#19923981)
They should have used "Laravel: The Framework Thomas Kinkade Would Have Created."
Re:PHP in 2019 by cutler on Thursday May 16, 2019 @11:30AM (#19929913)
Glad I'm not the only one who thinks "modern PHP" struggles to fit more than a couple of lines of real code on a screen surrounded, as it is, by space-wasting nonsense such as block comments, blank lines and K&R brace style. No wonder people prefer Ruby. Around the time of PHP5 the language ditched its own identity and sought to become the scripting version of Java. Give me back my procedural PHP4.
Re:PHP in 2019 by cntainer on Wednesday May 15, 2019 @08:31AM (#19918721)
Lol, I agree their packaging looks a bit different but the contents of the package are basically the same.

Working with both Laravel and Rails will make it clearer that they try to follow the same principles of convention over configuration and programmer happiness :).

Re:PHP in 2019 by davidy123 on Wednesday May 15, 2019 @11:43AM (#19920511)
PHP frameworks crack me up. They so often claim they're "powerful." What does that mean exactly, who is that language aimed at?

Then there is Laravel, why "artisans?" The word generally means pre-industrial. In my mind, that evokes devs doing edits on live code. Also, "Laravel" sounds like something to do with larvae.

Then there's Drupal, which for the longest time was "community plumbing," which did match the experience of having to call someone in for mysterious specialist emergencies.

Re:PHP in 2019 by ukyrgf on Wednesday May 15, 2019 @02:24PM (#19922250)
The command line tool for Laravel is named 'artisan'. You use it to do everything in Laravel, from setting up controllers/views to seeding databases.
Re:PHP in 2019 by davidy123 on Wednesday May 15, 2019 @04:03PM (#19923173)
I guess "Laravel - The PHP Framework For Web Scaffolders" wasn't catchy enough.
Re:PHP in 2019 by davidy123 on Wednesday May 15, 2019 @06:16PM (#19924317)
(Can't edit. I meant the word "powerful," not the language PHP).
Re:PHP in 2019 by codedokode on Wednesday May 15, 2019 @01:41PM (#19921850)
I don't like their code and architecture though. The code is ugly because it is built around static methods instead of proper OOP, and uses magic methods a lot. It is not easy to read.

Also, they love to invent their own names for existing things. For example, they named a folder with interfaces as "Contracts", although there are only interfaces.

You are using "Ruby on Rails" as some sign of quality, but if it uses magic and static methods like Laravel, I would consider it ugly too. Also, I remember reading somewhere that they were hotpatching imported modules. Luckily in PHP you cannot do it.

Re:PHP in 2019 by dabernathy89 on Wednesday May 15, 2019 @02:22PM (#19922225)
> it is built around static methods instead of proper OOP

The fake case against Laravel that never dies . The truth is found in the docs: https://laravel.com/docs/5.8/facades

> Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Re:PHP in 2019 by the_duke on Wednesday May 15, 2019 @02:52PM (#19922520)
What isn't fake is that Laravel uses magic methods everywhere, especially in the ORM layer.

There are way too many magic things happening under the hood for my taste.

Re:PHP in 2019 by munk-a on Wednesday May 15, 2019 @04:09PM (#19923213)
Magic methods in PHP are very commonly used to help reduce code verbosity - having come from working mostly in C++ I appreciate being able to express things succinctly.
Re:PHP in 2019 by malinens on Thursday May 16, 2019 @08:58AM (#19928526)
Much more important for code, especially library code is readability
Re:PHP in 2019 by mjlangiii on Wednesday May 15, 2019 @09:05PM (#19925260)
Laravel is moving away from magic methods to using facades, FWIW.
Re:PHP in 2019 by chipotle_coyote on Wednesday May 15, 2019 @01:56PM (#19921989)
The static methods you are seeing are by and large facades -- convenience methods -- but Laravel is still absolutely "proper OOP."

https://laravel.com/docs/5.8/facades

"Contract" is not a term they invented; it's a term from "design by contract programming," and Laravel enforces the "contracts" through interfaces.

https://en.wikipedia.org/wiki/Design_by_contract

(And, no, they did not invent the term "facade," either.)

Re:PHP in 2019 by astrodust on Wednesday May 15, 2019 @01:55PM (#19921979)
If you think Rails is ugly you're going to have to frame this with what you think is beautiful so we know where you're coming from.

Rails does take a lot of established concepts like MVC and mangles them pretty badly, but the Rails version of MVC works well in practice if you're willing to overlook how unconventional it is. The beauty is not in the adherence to dogma, but the day-to-day experience of using it when you know how it works.

It takes surprisingly little code to do some complex things in Rails. I'm working with GraphQL now and it's stupid easy to build out an API with Rails.

Laravel might seem all sorts of "wrong" to someone who has expectations of "how things should be", but the Laravel way, when accepted for what it is, works. It provides structure and cohesion which in the PHP world is in extremely short supply.