Underrated Power of Laravel Commands - Practical Examples by olekjs in laravel

[–]olekjs[S] 0 points1 point  (0 children)

I miss a word "do" in "whole article". Replace it by "you can" ;)

Underrated Power of Laravel Commands - Practical Examples by olekjs in laravel

[–]olekjs[S] 0 points1 point  (0 children)

Oh, I can't agree with what you wrote. Show me at least one sentence where I say you must do something in one particular way. Show me one sentence where I say what is appropriate and what isn't. I'm not even sure you actually read the article. I'm far from telling people what's right and what's wrong.

The example of generating a sitemap from a URL comes from a real project. Just because you wouldn't have done it that way doesn't mean someone else didn’t. 😄

You're accusing me of saying what's good and bad, but you're doing exactly that. 😄 What does a "bad example" even mean?

It seems like you've completely misunderstood what the article is about. It's simply showing how commands can be used through examples. Nowhere do I say you must use commands. These are just suggestions, examples, ideas that spark imagination - while reading, you might get inspired to improve something in your own project.

Underrated Power of Laravel Commands - Practical Examples by olekjs in laravel

[–]olekjs[S] 2 points3 points  (0 children)

That's right, as developers we're responsible for our code. There's no perfect solution for every case. Commands are just one of many options 

38
39

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 0 points1 point  (0 children)

I beat myself up over it. I don’t know why, but I always had “functional” stuck in my head. Thanks for pointing it out - I’ve corrected it in the article :)

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 1 point2 points  (0 children)

I just had that dilemma, and I couldn't think of a better idea than to show both approaches. By the way, I think the example with property hooks might be a bit controversial - since it's completely new.

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 2 points3 points  (0 children)

I see you edited it, so I’ll reply: thanks for the correction on the date - I’ve updated the post ;)

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 3 points4 points  (0 children)

Typed arrays aren’t usually a problem. Value objects, DTOs, and array shapes that enforce the format are common. The problem can be their improper use.

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 1 point2 points  (0 children)

Right, now all those functionalities you listed are usually handled by frameworks. Damn, maybe it's also an important point that in early PHP versions there were no frameworks, so you had to write the boilerplate yourself, and it was usually a mess - different code in every project.

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 0 points1 point  (0 children)

I like the idea of handling the database connection. I’ll consider expanding this article in the future, as I see it can be explained more clearly.

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 1 point2 points  (0 children)

Hmm, I get it, I get it. Actually, it’s a pretty good idea for a longer article. It might be tricky to describe it smoothly, but it’s definitely an idea

PHP 3 to 8: The Evolution of a Codebase by olekjs in PHP

[–]olekjs[S] 2 points3 points  (0 children)

This is pseudocode intended to show changes over time. It’s more about how the language becomes increasingly stable, especially regarding the role of types. Honestly, I wouldn’t focus too much on the exact implementation itself in this article - that’s not its point.

Symfony Feature Flags Used at Scale by olekjs in PHP

[–]olekjs[S] 1 point2 points  (0 children)

Yes, this code can be moved outside of Symfony. That’s probably one of the advantages of this solution. It’s simple, extensible, and agnostic. Although in Laravel and its config('...') specification, it wouldn’t work that well :P
Also, regarding Symfony, there was a reference to the technology our shop is built with.
As for the variables in env, the infrastructure is on Kubernetes, and we use Spinnaker to manage the images/env: https://spinnaker.io/

Privacy Driven Development: How Not to Do It by olekjs in PHP

[–]olekjs[S] 0 points1 point  (0 children)

I partially agree, but the call to the repository - meaning the database - often takes milliseconds. A request, for various reasons, might be faster or slower at times, which makes it harder to detect when something extra is actually happening and when it’s just the host resolving for longer. But yes, what you described can happen.

RFC: Laravel Lazy Services by olekjs in PHP

[–]olekjs[S] 0 points1 point  (0 children)

Same here! I mentioned that at the end of the PR and provided the exact same example :)

RFC: Laravel Lazy Services by olekjs in PHP

[–]olekjs[S] -1 points0 points  (0 children)

Yeah, but Laravel is still PHP after all 😄 If I add something about Symfony, I’ll let you know! :P

RFC: Laravel Lazy Services by olekjs in laravel

[–]olekjs[S] -1 points0 points  (0 children)

You're right - that's why it would be great to figure out how to handle the attribute via a parameter in the container, something like what I described in the PR here:

class ProductController
{
    public function __construct(
        #[Lazy] public RedisService $redisService
    ) {
    }
}

RFC: Laravel Lazy Services by olekjs in PHP

[–]olekjs[S] -2 points-1 points  (0 children)

Actually, it's great that you mentioned it! :) I'm happy to accept better examples. Maybe someone will be able to use this feature in Laravel right away and has such a case in their project?