15 ms·
Laravel 9
- exceptione 5y agoCan someone contrast Laravel with Symfony? Why would you pick one over the other when?
- Darmody 5y agoI'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.
- ziggus 5y agoDo you have any actual complaints?
- ceejayoz 5y agoThis doesn't match my experience at all, and given Laravel's popularity... this comment would be a lot more valuable with a why. I will say I opt out of the starter packs and Laravel Sail (their Docker-for-dummies basic setup) in favor of a more bespoke setup, but my Laravel experience has been great otherwise.
- rob74 5y agoNot the OP, but one thing that stands out for me is the (lack of) quality of the documentation. It reads more like a book (that tries to explain how to do things) than a reference (an exhaustive list of all classes, methods, parameters etc.). Ok, it's nice to have the former, but the latter would be far more important!
- raziel2p 5y agoIf you think so, it's available here: https://laravel.com/api/master/ https://laravel.com/api/master/
- bdcravens 5y agoDoes Laravel have anything akin to the Rails Guides? (ie, higher level based on what you want to do, rather than API-level documentation)
- vanviegen 5y agoThat does seem very, uhh, minimalistic, if that's supposed to be the reference documentation. Just one very short sentence per method. Most arguments are unexplained. No examples that I could find.
- yurishimo 5y agoI'm not sure what you're trying to find. The main Laravel docs are fine for 90% of what you would want to do. If you're digging into the core of some internal class trying to decide if you can re-use something elsewhere, that seems edge-case-y. The ORM, relationship model, templating, and routing are all thoroughly documented in the main docs. If you want to find out what obscure methods might be available for your custom package, you're probably competent enough to parse the auto-generated code docs or read the source directly (which is also very clear and well organized).
- dabernathy89 5y agoIt's actually not unreasonable to expect something that exists between the main documentation and the automated API documentation. Sounds like a great idea for someone to build and contribute back to the community!
- masterof0 5y agoCheckout Laracasts, Jeffrey Way is pretty good explaining things. I don't use Laravel (or PHP at all),but I do like his video tutorials a lot. I say this, because maybe is you the docs, or you cant find a way of doing something, etc...
- munk-a 5y agoWhen learning cool bird facts I really enjoy listening to people talk - but when trying to debug or learn a new framework I absolutely insist on written documentation. I need to be able to re-read paragraphs or segue to other topics briefly and then return which is incompatible with anything audio-visual. The existence of Laracasts was actually a strong disincentive for me to go with Laravel and I've been quite happy over in Zend/Laminas land.
- omnimus 5y agoSo you decided not to use framework because there is website with video courses about it? Interesting reasoning. Isnt there website with videos about the other framework?
- munk-a 5y agoThere were a few reasons that was just one of them. My concern was that the website with video courses might supplant text based tutorials. Additionally, we've all got different learning styles - I've got ADHD so video courses are extremely ineffective for me.
- mattl 5y agoI'm curious what you don't like about it. I work with a team of people who love it.
- hackandtrip 5y agoWhat would you suggest as idiomatic server code which is not Laravel, in PHP? I had the "pleasure" to work a bit with a PHP legacy server written in Laravel, and I thought that the framework was alright - the problem was in the PHP code written with it (specifically its typing). I think laravel is opinionated and can help to have a consistent codebase... curious to know why you had such a bad experience, and where you were happier :D
- peterangular 5y agoI've been programming PHP since around 2003 and although I don't find Laravel to be perfect, I find it to be a very solid framework to build general web solutions with. I have successfully launched everything from complex OAUTH solutions handling insane amounts of traffic, to dumb startup ideas, to just simple CRUD apps I use in my own personal life. I find it to be fully featured, incredibly well documented, and easy to use/learn. I find it to be my favorite "RAD" tool for generic API development. Also, the community is pretty solid too - specifically the IRC channel. I'll go far enough to say that Laravel has positively motivated my development as a software engineer - it's opinionated but I find it to be opinionated in a good way. Example: Laravel is heavy on testing/tooling which I think is outstanding. I am really curious as to what specifically you're finding problematic?
- celestialcheese 5y agoHonestly surprised by this. It's an opinionated framework, but it's consistent and the ecosystem is rich with options. I've been very happy working inside the laravel ecosystem for the last couple of years.
- chipotle_coyote 5y agoA problem with any "opinionated" framework is that people may disagree with the opinions. :)
- TimWolla 5y agoThis 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 half of the classes of Laravel Passport within the DI container to fix issues upstream wouldn't acknowledge at the time / doesn't acknowledge. Some of them are fixed by now (e.g. they finally support non auto increment Client IDs OOTB), some of them are not when I last checked. I wouldn't choose Laravel again.
- henry700 5y agoExactly 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.
- porker 5y agoIt sounds like Doctrine https://www.doctrine-project.org/ https://www.doctrine-project.org/ is what you need if you want an ORM to handle relatively complex stuff. It's the default in Symfony projects and I don't know if there's a Laravel integration. ASP.NET Core is nice mind; if you have the choice... :)
- cutler 5y agoASP.Net Core runs perfectly well on Linux so cheap VMs are an option now.
- fendy3002 5y agoI don't know if many share the same sentiment, but mine is to keep ORM use to the simplest of query. Anymore complex than that is better to be developed with raw queries, which also usually supported by the ORM.
- PZ81JUXJE7uJ 5y agoGiven the success of the framework, you just might need sone more time before it clicks
- KerryJones 5y agoI've been programming in PHP since ~2000, I've created giant systems with vanilla PHP, Kohana, Code Igniter, WordPress, and for the last ~8 years, Laravel. It's been a dream to work with. I, like others, am curious about what your actual complaints are more than "I hate it". As others have said, its opinionated, but its opinions tend to be strong ones with good data. It is also extremely customizable, with a smaller learning curve than most other frameworks and a richer community and documentation that the vast majority of frameworks. If I were to hazard a guess, you're running into your opinion being counter theirs?
- sequoia 5y agoDownvoting because you're not adding any info besides 'laravel bad.' I am interested in your experiences, but "I hate it" isn't useful by itself.
- e12e 5y agoPlease tell us why?
- dabernathy89 5y agoThis is a wildly unhelpful comment without additional explanation. My guess is you're doing it wrong.
- ricardonunez 5y agoI think I know where you are coming from. The first time I touched laravel was somewhere 2016-2017. I loved the way you got started and using valet got your app up and running a few minutes. Recently I wanted to do a quick project and noticed it is getting bloated. You have multiple paths you can follow instead of being straight forward. It adds to the learning curve. It is ironic because some of this new things were supposed to make it easier to create an MVP, but what happens is that it makes it harder to learn how the framework operates and integrates with all the new features.
- geenat 5y agoLaravel 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.
- pak9rabid 5y agoHaving worked in both environments (framework vs no framework), for anything other than very trivial apps, you want the framework to force everyone into a common way of doing things. Otherwise the project turns into a a massive clusterfuck of everyone doing their own thing, often with many instances of "reinventing the wheel" going on.
- dgb23 5y agoYou 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.
- ThatMedicIsASpy 5y agoSymfony components would be the better choice? Did they change Laravel to only include what you want like Symfony?
- unfocussed_mike 5y agoYep -- 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.
- cmg 5y agoI went kind of in another direction a few years ago - CodeIgniter's routing/sessions/etc base was plenty for most of my projects, but I wanted a real ORM. So I integrated Eloquent from Laravel and ignored the built-in CI database layer. A bunch of these sites are still running smoothly on modern PHP.
- jackconsidine 5y agoExactly 45 minutes ago I went on Laravel docs and saw the "you're on an old version of Laravel" message on the Laravel 8.x docs. Wow, I thought, Laravel quietly dropped a major release and I didn't even see press for it.
- riipandi 5y agoDon't forget to watch Laracon Online, tomorrow on Youtube.
- unfocussed_mike 5y agoOoh thanks for this.
- progre 5y ago_
- danielhlockard 5y agoI fail to see how this is related at all to laravel.
- daveaiello 5y agoCould 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.
- KerryJones 5y agoThe Laravel from Scratch will still largely be applicable, the changes in 9 won't be breaking enough for you to be missing out a lot. The upgrades tend to be painless with a few small tweaks you might have to make (and those are usually described on the upgrade page). If I were you, I'd start with Laravel 8.0 as you go through the Laracasts, and when done, go to the upgrade page of Laravel 9.0 and checkout the changes.
- devNoise 5y agoGo 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 framework. v9 may have some breaking changes, but I'd have to really dig through the release notes to find what would affect my app. I'm more concerned with updating PHP from 7.4.x to 8.x then the framework update. Our test env had issue with one of our blade templates when running under 8.x.
- unfocussed_mike 5y agoYep -- 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.
- durpleDrank 5y agoYou could try LUMEN which is a lite version of Laravel. Took me around a day or two to fully get what was happening. I'm at the point now where I want to switch a big project I've been working on over to Laravel but it's a bit of a PITA. Anyway, for hello world stuff or a small api project try beginning with LUMEN. https://lumen.laravel.com/docs/8.x https://lumen.laravel.com/docs/8.x
- XCSme 5y agoI 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 needed, can reuse code from one project to another, understanding what the code does requires zero-framework knowledge, performance is as good as it can be, as every file executes only what's needed and doesn't create unnecessary abstractions, etc.)?
- castis 5y ago> Why should I consider Laravel If you work on all those projects alone, and you're happy doing this, you probably wouldn't. You aren't the target market for a framework like this. Laravel (and any good framework, really) is for people who want a consistent dev experience _with good documentation_.
- XCSme 5y agoYes, I do work alone on those projects, but I do use frameworks on the frontend-side as I find them to help in the long term, not hinder the projects as PHP frameworks do (a lot of boilerplate). It makes sense that if Laravel is strongly-opinionated to result in a consistent dev experience, but is a consistently bloated dev experience better than an inconsistent lean one?
- colecut 5y agoBloat can be mostly ignored, inconsistencies can not.
- unfocussed_mike 5y ago> You aren't the target market for a framework like this. I don't know about this. But then I am of an age where I consider myself to be a team of programmers separated by time. There are the younger, less easily tired versions of myself who thought this was a great idea for a career and lived on takeaway curries, there's me, and there are the four or five older versions of myself who will hate me for trying to be clever and not trying to be consistent. Laravel helps me take on projects that allow me to hand off pieces of work among my team ;-)
- defenestration 5y agoWe have been using Laravel for over 8 years. Nothing but praise. It's a framework we could rely on. No painful upgrades and clear documentation. For us it's a pleasure to work with. I also recommend Laracasts from Jeffrey Way.
- KerryJones 5y agoSeconded this in its entirety. Been to Laracon multiple times, use it for all my side projects (as well as startup). Has performed remarkably well and more consistently than any other experiences I've used
- riipandi 5y agoYeah. Maybe what we love from Laravel isn't only great docs and painless upgrade process, but also the great ecosystem.
- unfocussed_mike 5y agoIt's the fact that it has a culture of grown-ups. Where by "grown-ups" I mean there is an avoidance of cute hacks for the sake of things, there is an approach where nobody assumes anyone is the same kind of expert, and takes care to contextualise. There is a stronger emphasis on being able to _write_, to explain, etc. I love really cute hacks and neat minilanguages and metaprogramming and all that when I am doing things for fun. But when I am working, I want documentation, not five-line git READMEs that presume I am up-to-date.
- sdoering 5y agoI wanted to try it. I wanted to see if it could help me solve a business problem. Sadly I just wasn't able to understand the first steps to get something out there. I really still want to like it. But currently I have no idea how to practically start.
- deleted 5y ago[deleted]
- jackconsidine 5y agoFor 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.
- dragosmocrii 5y agoyes, 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.
- jackconsidine 5y agoYeah 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.
- pluc 5y agoThe 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
- tomschlick 5y agoThe 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.
- sibit 5y agoAnyone know if/when they'll push these changes to their micro-framework Lumen (https://lumen.laravel.com/ https://lumen.laravel.com/)?
- ceejayoz 5y agoMy sense is Lumen's eventually going to go away, with the heavier built-in stuff moved into optional packages like the starter kits at https://laravel.com/docs/9.x/authentication#authentication-quickstart https://laravel.com/docs/9.x/authentication#authentication-q....
- ceejayoz 5y agoUpdate: Yep, straight from the horse's mouth. https://twitter.com/taylorotwell/status/1441101127496323080 https://twitter.com/taylorotwell/status/1441101127496323080
- unfocussed_mike 5y agoI really, really need to look at Breeze and Jetstream.
- unfocussed_mike 5y agoExcellent. The LTS nature of this release is good news (because presumably it involves the Laravel team committing to supporting the version of Symfony they use for some components).
- neals 5y agoI've used Laravel on and off. But I always run into uncertainties when doing large refactorings. How are you doing large refactorings?
- deergomoo 5y agoAs with any dynamically typed language, good test coverage is important.
- jordanmorgan10 5y agoI met Taylor a few years ago at a conference we were both speaking at. Coming from the iOS world, I had no idea who he was. "So, what do you work with?" "PHP mainly", he said. I replied "That sucks, sorry man." ¯\_(ツ)_/¯
- 0des 5y agoWhat was his response?
- benreesman 5y agoMaking money in PHP is better than making none at all!
- jordanmorgan10 5y agoWe both just laughed
- 0des 5y agoGlad he was able to take it in stride. I bet it was funny when you realized who it was
- dabernathy89 5y agoWe're used to it . You're wrong, though!
- jordanmorgan10 5y agoHaha not surprised - ecosystem seems to be doing very well.
- phendrenad2 5y agoThe fact that everyone thinks that PHP is terrible is really good at keeping the ecosystem healthy. No one is swooping in and overcomplicating the stack for internet brownie points. If something exists, it exists to solve a real problem.
- chipotle_coyote 5y agoPersonally, I liked Laravel when I was first investigating it years ago, but was always a touch put off by the pervasive "I am beautiful, adore me" undercurrent throughout its design, documentation, and even comments. I'll be the first to admit that's not a rational critique. Having said that, though, Laravel is relatively unusual among major frameworks in that it doesn't seem to have been developed in tandem with a real-world project like Rails and Django were (e.g., BaseCamp and the Lawrence World Journal's internal CMS), but rather developed just to be "a better framework." Each successive release of Laravel seems to push even harder at tying you up with other Laravel add-ons, some of which are paid services. Rails and Django are open-source projects, but Laravel is an open-source product. Again, not necessarily bad, but there's an increasing feeling that the Laravel commercialization model is "give us sufficient money and you'll barely have to write any code." My other nitpick with Laravel is that learning to develop with it is often learning to develop specifically for Laravel rather than learning to develop for PHP. This is a charge leveled against Rails and Django, too, but Python and (perhaps especially) Ruby are just better languages for developing DSLs in. Laravel has to jump through a lot of hoops behind the scenes to do what it does, leaving you with a framework that isn't particularly nimble and design patterns that often aren't particularly applicable to the rest of the PHP world. If you're willing to hop fully on board with the Laravel train, none of this may be an issue for you. But at this point I'm not convinced that smaller PHP projects, at least, might not be better off without frameworks at all. Use Composer to pull in specific packages that you really need, and ask "if I can get the functionality I need from this package with an afternoon's work, is the package bringing anything to the table that I still want" before adding them. (Sometimes the answer is "yes," but not always, and I tend to be wary of packages that primarily just wrap other packages.)
- unfocussed_mike 5y agoFWIW I have never once interacted with Laravel's commercial model, or felt that I am being engineered into it. I just don't give it another thought.
- chipotle_coyote 5y agoI haven't interacted with it, either. "Engineered into it" would be too strong a phrasing, but it's hard not to get the impression Laravel's creator(s) really, really want you to use their other services. I mean, compare the menu bars of rubyonrails.org, djangoproject.com, and laravel.com: Rails's first links are "blogs" and "guides"; Django's first links are "overview" and "download"; Laravel's first links are "Forge" (their commercial provisioning service) and "Vapor" (their "serverless" deployment platform).
- phplovesong 5y agoI thought Laravel was dead. Well looks like some people still like to use these slow and bloated frameworks. I cant say i miss the PHP ecosystem of bloat.
- FinalBriefing 5y agoI'll take the bait. Laravel is far from dead; it's more popular than ever. The older versions that you might be familiar with have seen a lot of improvements over the last couple of years. They're fairly aggressive with deprecating older versions of PHP, while still supporting LTS versions. Its ecosystem is really flexible, and generally has great solutions for anything web-related with easy configuration. I haven't found Laravel to be slow when building websites, but we always put a CDN in front of it, so it doesn't really matter how fast or slow the framework is. If you want a lighter-weight core to start with, there's Lumen, which is designed to be an API-only version of Laravel. Forget templates, just return JSON (or whatever). Laravel is a great solution for a lot of websites and applications. Maybe not some applications you have in mind, and that's ok. Pick the right tool for the job. As someone who used to hate PHP, modern Laravel would be my go-to if I need a backend and can't simply get by with a static site generator.
- 0x7f5da9 5y ago> If you want a lighter-weight core to start with, there's Lumen It's been few years, but last time I tried it, the first thing it did was pulling close to 100 dependencies. I worked on few fairly large codebases (Symfony, Nette) and those were never even close to that. I realise it's not a good metric, but it really felt like an NPM project. Has this somehow changed?
- jstummbillig 5y agoAll else being equal, how do we feel about Rails 7 vs Laravel 9 in 2022? Giving the breadth of both frameworks I am pretty certain there has to be one objectively better choice. Which one is it? Why?
- e12e 5y agoI don't think either is objectivly better - if for no other reason than ruby and php being quite different languages. Personally I much prefer ruby - but I could perhaps see myself reaching for Laravel for a project depending on requirements.
- jmcharnes 5y agoAs a Ruby developer I resonate with this. I love a LOT about the Laravel ecosystem, but I also still really love Ruby and Rails.
- jstummbillig 5y agoWhat requirements does Laravel meet that Rails does not?
- yurishimo 5y agoMarginally cheaper/easier to deploy. Very robust queue system built in. Where you'd pay for Sidekiq in Rails, that's included in Laravel. Auth is also more streamlined since Laravel takes a stance on what the default is unlike Rails (though I admit most people just use Devise). I think PHP is still faster as a language? There are also tools available now to run Laravel apps on serverless infrastructure if that's something you don't want to mess with. I'll admit I'm biased and haven't spent much time with Rails outside of a hello world and various podcasts.
- e12e 5y agoI'm guessing it's feasible to deploy to shared hosting for example?
- FinalBriefing 5y ago
- ipaddr 5y agoWhat does everyone recommend for learning testing with Laravel?
- ricardonunez 5y agoThe documentation is pretty straight forward. Just follow it and you can get it running in a few minutes.
- tomschlick 5y agohttps://testing-laravel.com/ https://testing-laravel.com/ https://laracasts.com/series/build-a-laravel-app-with-tdd https://laracasts.com/series/build-a-laravel-app-with-tdd https://course.testdrivenlaravel.com/ https://course.testdrivenlaravel.com/
- _xnmw 5y agoAs a solo bootstrapped SaaS founder that literally relies on my app to pay my rent and food, I owe my sanity to Laravel. I've been doing web development for 10+ years. Nothing else understands the needs of a business owner AND solo programmer like Laravel does. I worked with Python (Flask/Django) for (4+ years) longer than I worked with Laravel (only 1 year), and yet I'm already 10x more productive in Laravel than I have ever been in Python. Software projects follow Conway's Law, i.e. [1] the software architecture reflects the team structure. Laravel reflects the needs of business owners and one-man-companies because it is built by a business owner and has an ecosystem supported by one-man-companies who build high quality products for profit. I want beautiful high level abstractions AND a theoretically sound framework that is battle-tested in production. Laravel gives me both. The number of headaches that Laravel just solves for me, out of the box: 0. Background Jobs/Queues/Rate Limiting/Retry logic handled by the excellent queueing framework 1. Rock solid server deployments/DevOps handled by Laravel Forge 2. Seamless version upgrades handled automatically by Laravel Shift 3. Backend-agnostic full-text search built into the framework with Scout 4. ORM which seamlessly enables caching, lazy loading, advanced subqueries, dynamic scoping, or just mixing in raw SQL when you need it 5. And there's just so much more. I live and breathe Laravel. [1] https://en.wikipedia.org/wiki/Conway's_law https://en.wikipedia.org/wiki/Conway's_law
- jw1224 5y ago> As a solo bootstrapped SaaS founder that literally relies on my app to pay my rent and food, I owe my sanity to Laravel I’m in the same boat as you, and I couldn’t agree more. Your comment absolutely nails it. Laravel is a pleasure to work with. It takes care of 95% of everything I could ever need from a framework. And that last 5% is guaranteed to be covered by a high-quality community package. (Just look at Spatie, this is all just from one maintainer! https://spatie.be/open-source https://spatie.be/open-source ) Some commenters in this thread seem to take issue with Laravel’s “artisan” approach… and yeah, sure. Maybe it’s a bit pretentious. But, whatever. They’ve earned it. Laravel, its ecosystem and community takes pride in being polished and professional — and rightly so.
- unfocussed_mike 5y ago
- iio7 5y agohttps://phpthewrongway.com https://phpthewrongway.com
- tomschlick 5y agoAh yes, the world of everyone using a bespoke framework that almost always gets rewritten once the original programmer leaves a company is obviously the way forward! /s
- withinboredom 5y agoDoctrine + graphqlite. It’s all you really need for a sane API, you don’t even need a router unless you just want one.
- hparadiz 5y agoI'm just now learning (week 2) Laravel after coming from using other custom frameworks for years. For the record I have my own framework with a fully featured ORM of it's own and 99% unit test coverage for said ORM which is a fork of one my friend started 15 years ago and I have contributed to for several years. We started it before Laravel existed and in many ways it's exactly like Laravel. [https://github.com/Divergence/framework https://github.com/Divergence/framework] But anyway..... So far what I like: - Migrations - The ORM is pretty good - Query writer is aight - Blade - Mixx - built in CLI So far what I don't like: - All routes defined in one single file instead of procedurally in each controller (performance wise this is terrible cause you're running a bunch of regular expressions on each and every request. augh) - File structure doesn't adhere to PHP league standard [https://github.com/thephpleague/skeleton https://github.com/thephpleague/skeleton] All PHP code should be in src directory or tests directory. - [php artisan] - each project should have a file in bin folder with a PHP shebang [#!/bin/env php] with +x on the file and linked globally so instead of writing php artisan you would write $projectName instead. Link it globally even. - .env file - just use PHP files for configs which opens many possibilities like inheritable config setups. Instead of just dev or staging or prod you would instead have main, dev, production where main is env variables that don't change between environments. - Docs aren't great. Eloquent needs a PHP.net -like page where I can see every single member function but instead I google and get the getting started docs which gloss over the best features. I have to manually sit down and read the source code.
- jonwinstanley 5y agoI doubt the routes are evaluated with regular expressions on every request, more likely it’s matched based on an explode of /
- philo23 5y agoI think quite a lot of the PHP routers are based on regexes, for better or for worse. One of the most famous is FastRoute by nikic that (from memory) merges all your routes into one big regex and then tells you which route to dispatch based on some index that comes back in the match. I don't know how widely that specific library is still being used though or if it's since been replaced by something better. https://github.com/nikic/FastRoute https://github.com/nikic/FastRoute
- subsaharancoder 5y agoGetting started with Laravel on Mac required me to fire up Docker desktop which I don't particularly care for but I proceeded because I like to try out new things, so I followed the documentation https://laravel.com/docs/9.x#your-first-laravel-project https://laravel.com/docs/9.x#your-first-laravel-project: - Fired up Docker desktop - ran curl -s "https://laravel.build/example-app https://laravel.build/example-app" | bash and "cd example-app" - typed "./vendor/bin/sail up" and got an error "no such file or directory: ./vendor/bin/sail" - Deleted the example-app and ran curl -s "https://laravel.build/example-app https://laravel.build/example-app" | bash and "cd example-app" - typed "./vendor/bin/sail up" and got another error "no configuration file provided: not found" By this time my MBP fan sounds like an Airbus A380 getting ready to takeoff and I'm already frustrated with the framework, not sure what I'm missing!!
- throwaway829 5y agoThe docs push you in the docker direction, but they also have Laravel Valet which "is a development environment for macOS minimalists": https://laravel.com/docs/9.x/valet https://laravel.com/docs/9.x/valet A lot of Laravel devs use Valet instead of Docker.
- nam2 5y agoYuck.
- chakhs 5y agoLaravel is amazing until you need to do something non-trivial that does not follow the laravel way of doing things so you find yourself fighting the framework. Everything is coupled to Eloquent for example, and while you can use another ORM, the whole ecosystem and 3rd party libraries need Eloquent, so you have to choose to either do things the Laravel way to take advantage of the community, or write everything on your own. P.S: It's been 3 years since I used Laravel, not sure if things have changed.
- midrus 5y agoWhy would you use another ORM? I've worked once in a project where a very opinionated dev lead "decided" SQLAlchemy was better than the django ORM, so he replaced it. The mess he created was unbelievable, we spent years cleaning things up and some part we even couldn't. > have to choose to either do things the Laravel way to take advantage of the community, or write everything on your own Of course! that's the whole point of a framework, to put some guardrails on how to do things. If you think you can do things better, more performant, more tested, and more documented, good for you, go ahead and just write raw PHP or tie together your own libraries. You can't blame an opinionated framework because bastardising it is not easy. That's a feature in my book.
- Ambix 5y agoLaravel is great, but sometimes just overkill for simple tasks. That was the reason for me to start PHP Comet, it's like SlimPHP on async steroids: https://github.com/gotzmann/comet https://github.com/gotzmann/comet