Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Learning Laravel - How?

raindog308raindog308 Administrator, Veteran

@MikePT hit me up on PM to ask "I'm interested in learning PHP then Laravel to create several projects. Do you have any advice where I should start?"

I'm actually not a big PHP programmer. I find the language trivial to write in if you already know related languages (in my case, after perl, python, shell, and various "big boy" programming language, I didn't find any new concepts in PHP, just different syntaxes).

However, I think learning Laravel is kind of a different animal. You can know PHP and be swamped in your first Laravel project because it has so many new concepts if you have never worked with a major framework before:

  • the whole MVC pattern - controllers, routes, etc.
  • many more sophisticated OOP concepts that you probably don't run into if you're just writing one-off PHP scripts
  • the ORM (object-relational mapping)
  • the templating engine
  • etc.

Also, the Laravel docs push users towards using vagrant and homestead, which is a viable path but one I ultimately found injected another set of novel information I didn't need. I think just setting up Laravel on your VPS is a lot easier, but of course not every developer works that way.

I found Laravel pretty easy to learn, but had already done work with CakePHP and CodeIgniter, and so many of the concepts were not new. But I think if someone wanted to write his first Laravel program, he'd need to (1) learn PHP to a reasonable degree, (2) the concepts of an MVC framework, and (3) how Laravel implements them, though for expediency (2) and (3) could be combined.

So if you were going to learn Laravel from scratch, how would you proceed?

  • any specific books?
  • Laracasts?
  • Youtube channels?
Thanked by 2job0121 Ympker

Comments

  • Yup, you pretty much answered it.

    Learn

    • Core PHP
    • Object Oriented PHP
    • Basic web security like sanitizing user input, escaping user output, sql prepared statements (to avoid sql injection), prevent directory traversal attacks, not trusting the user at all :P etc. Don't skip this or else you will get hacked 100% (framework won't save you)
    • Design Patterns used in Laravel like MVC, Dependency Injection, Factory etc.
    • Database sql for CRUD (create,read,update,delete)

    and now you can learn laravel by either reading docs from start to end https://laravel.com/docs/9.x OR watching the latest laracasts.

    More useful resources:

    Honestly, I find laravel too bloated, over engineered with abstractions and filled with magic. I usually just pick a minimal router, template engine and ORM library and get things done. Far more easier to maintain the app and upgrade to keep up with the latest active PHP release. If you are a team, you may find it useful to use a framework like Laravel, Symfony to enforce rules and restrictions.

  • ZerpyZerpy Member

    The main places I learn concepts from in Laravel are mainly their own docs, their Discord (They're super helpful over there), as well as in my case, I'm using Livewire for Laravel - and the community around Livewire in general is exceptional, not to mention there's some very nice screencasts available by the authors.

    I think Laracast as well is one of the great resources of Laravel.

    Laravel does do a lot more "hand-holding" than many other frameworks do - it's not a super lightweight framework (however, it's fast enough for most people).

  • If you have a few hours, this video just came out 2 days ago:

    Thanked by 1ehab
  • LeeLee Veteran

    The Laravel docs are excellent. Laracasts really is the best resource for Laravel at the minute.

    Instead of Vagrant & Homestead, you can get a fast local set-up using Laravel Valet, I use it constantly. It is for Mac but there is a Windows version.

    That said Laravel isn't a way to skip learning PHP in the first place.

  • Good to see @MikePT is constantly trying to improve, learn and aquire new skills :D Life-long learning is a thing and it's great :D Also following this!

    Thanked by 1raindog308
  • dane_dohertydane_doherty Member
    edited April 2022

    Don't get cucked into learning Laravel. Learn a microframework instead. Full-stack PHP frameworks and sex offender registries are what ruined this country.

    Thanked by 1kunrent
  • vedranvedran Veteran

    Microframeworks are good for microprojects, but as your project grows you'll need more than the framework can offer and you'll end up reinventing the wheel a lot.

  • @vedran said: but as your project grows you'll need more than the framework can offer and you'll end up reinventing the wheel a lot.

    Isn't that the case with Laravel as well? Let's take its Eloquent ORM for example. It's neat for simple use-cases but when you need something non-trivial, you'll exhaust its capabilities pretty easily and have to resort to raw DB queries, only now with extra overhead of useless ORM.

    When people think "framework", most of them really mean 60% routing and 20% template engine, both of which can be realized as seperate components without all the framework bloat. This is exactly what Express.js did and that's part of why it's wildly popular and pushing out L*MP in favor of MEAN stack.

    Thanked by 1angelius
  • Frameworks are bloated, slow and deprecated with all the breaking changes ceremony.

    I stopped using them 20 years ago, and I do work on very big projects (up to few million LOC).

    Guess what, without a framework and millions of dependencies your code can be nearly immortal and a lot safer, faster and simpler to maintain compared to all others deprecated frameworks projects that now can't be recompiled without nearly a full rewrite

  • @dane_doherty said:
    Don't get cucked into learning Laravel. Learn a microframework instead. Full-stack PHP frameworks and sex offender registries are what ruined this country.

    Completely agree, 100%, the only useful parts out of these bloat projects, is the routing component(s), and those are still bloated (symfony is one example).

  • raindog308raindog308 Administrator, Veteran

    @vedran said: Microframeworks are good for microprojects, but as your project grows you'll need more than the framework can offer

    Funny, but that's supposed to be their strength!

    I've also heard of projects where they go gung-ho on some framework version 2.2 and it doesn't do exactly what they want, so they get in and muck around with the internals. Then when 2.3 is released it's hard to upgrade, and soon they're running an ancient framework while everyone else is on 5.0.

Sign In or Register to comment.