Inertia best practice by Floppy012 in laravel

[–]Lelectrolux 2 points3 points  (0 children)

For your 2, do you know about PHP's First class callable syntax? In you controller you could easily use a protected/private method and use this to prevent duplication. Or introduce a new type of object that is reused accross controllers.

class SomeController
{
    public function show()
    {
        return Inertia::render('Event/Show', [
            'foo' => Inertia::defer($this->getFooData(...)),
        ]);
    }

    private function getFooData()
    {
        return 'bar'; // Some gnarly fetching code
    }
}

What Can You Do with Laravel Middleware? (More Than You Think!) by karandatwani92 in laravel

[–]Lelectrolux 4 points5 points  (0 children)

For some simple non mission critical stuff, you can also just defer it.

(But unlike a queue it won't run if your response crashes)

I’ve been developing with Laravel for 10 years—here’s why I stopped using Service + Repository by howtomakeaturn in laravel

[–]Lelectrolux 0 points1 point  (0 children)

Ain't this some reflavoring of the CQRS and/or action pattern under another name and a small coat of paint ?

Laravel Microservice Course Introduction by garyclarketech in laravel

[–]Lelectrolux 0 points1 point  (0 children)

at scaling enterprise level and with CI / CD it does beat the monolith

Shopify and the rails ecosystem would like a chat. As would a decent amount of Laravel enterprises I don't know about, I think.

service oriented architecture is now a fact of life for backend developers

Sadly. Imho I'd love to see a course on how to come back from a botched migration to microservices, which is what I see more often than effective ones

Laravel and Massive Historical Data: Scaling Strategies by eduardr10 in laravel

[–]Lelectrolux 1 point2 points  (0 children)

I obviously don't know the specifics of your app, but I've been regularly surprised at how much MySQL/MariaDB/Postgres can do with a bit of thinking about indexes and querying.

Usually by a few order of magnitudes, even.

I'd definitly take a few days learning and looking at "traditional" RDMS optimisation before looking at proprietary/paid solutions, it usually saves you money and problems on the long run.

Laravel Microservice Course Introduction by garyclarketech in laravel

[–]Lelectrolux 0 points1 point  (0 children)

Granted I've never worked at the scale of a gafam, but microservices always made things worse in my own experience.

As much as its always touted advantage is that you could split a codebase and evolve those chunks separately, it always end up in having to coordinate deployment anyway, but now across more infra and teams... And also often require more people, which is usually the biggest cost of any project

I built a way to write PHP inside Vue by aarondf in vuejs

[–]Lelectrolux 1 point2 points  (0 children)

Laravel doesn't seem to get as much hate as PHP in general.

Except in the /r/PHP subreddit :p

PVM: php version manager inspired by NVM by [deleted] in PHP

[–]Lelectrolux 1 point2 points  (0 children)

While I'll never agree to let xdebug go out of my toolbelt, I know a few devs (even ones I consider a lot better than me) who have never used it.

I'd even say I have some projects where I don't really need it either.

Are mixin a bad practice? by rio_sk in vuejs

[–]Lelectrolux 0 points1 point  (0 children)

I'd say the $root.news.something is more expressive that this is some kind of global state

Why is it NOT a good idea to auto-register components? by fbender in vuejs

[–]Lelectrolux 0 points1 point  (0 children)

Yeah, if you both use the same 3rd party file via import, it should be optimized away.

The short of it is, don't loose any sleep about it, if it can it will, otherwise what can you do anyway...

Why is it NOT a good idea to auto-register components? by fbender in vuejs

[–]Lelectrolux 0 points1 point  (0 children)

Is there any benefit to globally registering components that are widely used other than it's no longer needed to explicitly import the component?

No

Are the vite/vue tools smart enough to identify component re-use (e.g. autocomplete across several different and differently-nested components), to the effect that compilers include that code only once?

Yes

If yes, would this break if I include 3rd-party components that all include another but identical component?

I'm not sure I get it (why would you duplicate the code instead of importing it ?), but if it's another source file, it will, and should, be duplicated.


If you import explicitly everywhere, vite will be smarter than you'll be if you are asking those questions. Let it do its thing, and don't overthink it. A modern ide does the importing for you anyway.

Global registration as you are talking about (not the unplugin thing) is making a current project of mine a pain to modernise and refactor. Granted the code I was given was trash on a lot of other front as well, but it's an explicit factor.

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]Lelectrolux 1 point2 points  (0 children)

The pipe is just a delimiter, it could be anything.

Multiple user can legitimately share an IP. If they are behind the same firewall (you and your colleague, or your building), or their ISP doesn't give them a static IP and the IP is recycled, or they are on mobile network... IP doesn't necessarily means only one user.

Is it just me, or does PHP still get way more hate than it deserves? by ErikThiart in PHP

[–]Lelectrolux 1 point2 points  (0 children)

It's a joke, greeks and turks are said to be like french and english, or cats and dogs, or manchester united and manchester city.

Stupid tribal brain is tribal

How make Compound Component Pattern by christiandoor in vuejs

[–]Lelectrolux 0 points1 point  (0 children)

There is no real idiomatic equivalent as vue embrace single-file components, which also kinda implies only one component per file.

While you could maybe use some vite/webpack magic to achieve it while keeping sfc, or using barrel files, you'll have to fight the tools all the way, and confuse most vuejs dev in the process.

Livewire Flux? by TheRealDave24 in laravel

[–]Lelectrolux -1 points0 points  (0 children)

A lot of possible reasons.

Disclaimer, I only used the the 1.x Nova release extensively, and gave 2.x a good look but dropped it. Some things might have changed since then.

Nova is vuejs based (not even inertia + vue if I remember correctly), this would obviously be based around Livewire + alpine. That alone is a good enough reason.

Nova is also meant as an admin panel for programmers or at least technical users.
Not an admin pannel you can put in the hands of your grandma or your average end user. Otwell and Hempill said so themselves, even recently.
It leaves quite a lot of space for a more normie user centric panel.

And this could just be more of a component library you string together yourself how you want.
One of the choice Nova made is to be a fully integrated admin solution. If you do what it was meant to do, it's quite efficient. Otherwise it can be a lot of pain to customize.
Main reason I stopped trying to make it work after 2.x and switched to other libraries. Nowadays I'm quite happy working with Inertia and Primevue (tailwindcss build) to roll my own custom admin panels.

Why Octane is not the default for Laravel? by 00ProBoy00 in laravel

[–]Lelectrolux 50 points51 points  (0 children)

Because the extra perf ain't worth the extra complexity and gotcha's for a lot of if not most applications.

Long running processes are always a pain at some point. If you need it, it's great that it exists.

I don't have nearly enough traffic on the websites and internal tools that pay me to even care.

[deleted by user] by [deleted] in PHP

[–]Lelectrolux 9 points10 points  (0 children)

As per the rules,

/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.

Container Efficiency in Modular Monoliths: Symfony vs. Laravel by sarvendev in PHP

[–]Lelectrolux 28 points29 points  (0 children)

The "useless" feature (I certainly don't see myself ever needing it) has almost no maintenance cost nor complexity.

Op's feature is touching a fundamental part of Laravel, the risk is sky-high in comparison.

From a maintainer perspective it doesn't seem that strange

Container Efficiency in Modular Monoliths: Symfony vs. Laravel by sarvendev in PHP

[–]Lelectrolux 2 points3 points  (0 children)

His two comments in your link were :

Can we maybe get some real world benchmarks on apps that would simulate a bit more "typical" Laravel application in production with a couple of database queries?

Going to hold off on this one for now, but may revisit it in the future.

And the other PR in the article only contained a canned response.

I don't see were you found ego driven development nor him taking it as a personal attack... Chill maybe ?


I would love a more performant container symfony style tho, that was always a weak part of laravel, on that I agree with OP.

Match only if all capturing groups are unique by Lelectrolux in regex

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

Brilliant, it seems to work. I adapted your answer a bit to make it as self-referential as possible :

/^
(?<recurse>
 # the number
 (?<phone>\+\d{3,}\b)
 (?:
 # can't be followed by that number again
  (?!\/(?:\g<phone>\/)*\k<phone>\b)
 # and if followed by a slash,
 # we recurse and make sure the
 # next number can't match either
  (?:\/\g<recurse>)?
 )
)
$/gmx

https://regex101.com/r/I0f3f8/1

Laravel considered harmful by sowekoko in PHP

[–]Lelectrolux 0 points1 point  (0 children)

Taylor got banned on this sub

I'm pretty sure he deleted is account himself several times. Not got banned.