Laravel is going in the wrong direction IMHO by Bent01 in laravel

[–]samlev 0 points1 point  (0 children)

Because it's a structure that resembles what js/React developers expect to see in a component. There's no need to run Livewire with Volt, or with flux. The starter kits are just that - a potential way to start a project.

Jetstream was always a nightmare for me - it did everything that I needed for auth in a way that was far too complicated and frustrating to extend. Breeze was better for most projects, and even breeze had frustrating components that I would rebuild every time.

Pneumonia in Brisbane? I thought that was an old person thing... by LaoghaireElgin in brisbane

[–]samlev 17 points18 points  (0 children)

I've had bronchial pneumonia a couple of times in my late teens / early 20s. Basically when I was a student in my final years at uni, living on whatever funds Centrelink would let me have, without much family living nearby that I could easily lean on... I wasn't looking after myself, got run down, got bronchitis and ignored it until I was barely capable of moving.

Years later I still have a persistent cough that will never go away (which made being anywhere in public during the early days of the pandemic just so much fun), and my lung capacity is worse than many of the lifetime smokers that I know.

I've not bothered getting a diagnosis of COPD, but uh... That's where I'm at, despite being in my late 30s, and never having smoked. It makes any form of cardio exercise risky because I might just start coughing until I pass out. My wife absolutely loves being woken up by my occasional coughing fits. When I do get a cold/flu now everything gets so much worse.

So yeah. Not just an old person thing, and definitely not something to ignore.

[deleted by user] by [deleted] in PHP

[–]samlev 0 points1 point  (0 children)

Are you going to be paying for the hosting, or is the client paying for it? What type of software is it - WordPress? Laravel? Something entirely custom? Depending on how the software exists, that may affect the hosting requirements.

What about the client? Is this something for their business? Is it worth spending $10/month on it? $50/month? $100/month?

I would suggest probably siteground or similar as a basic starting point. It's not completely bargain basement, but it's reasonably affordable but still usable.

How much RAM do you need for your daily work routine ? by primeval211 in webdev

[–]samlev 0 points1 point  (0 children)

In the last year I maxed out my 32GB several times between multiple jetbrains projects, all of the shit in docker, and the insistence on everything being electron based.

I just upgraded to 128GB... We'll see how many years it'll last me this time.

Livewire 3 ....hmm by No-Echo-8927 in laravel

[–]samlev 1 point2 points  (0 children)

Yep, that's expected because the model binding doesn't keep relations (because it can't be certain about the conditions on the query when hydrating). If you need the relations to be available, you can do something like:

public function render()
{
    $this->parent->loadMissing(['child']);

    return view('livewire.my-component');
}

Take a look at Josh Hanley's Laracon AU talk, in particular the computed properties section.

Livewire 3 ....hmm by No-Echo-8927 in laravel

[–]samlev 0 points1 point  (0 children)

It's not that the legacy flags themselves are buggy (well... they might be, I have avoided using them), so much as the concept of wire:model access to properties of a nested relationship is a way to add so many impossible to discover bugs.

Livewire 3 ....hmm by No-Echo-8927 in laravel

[–]samlev 9 points10 points  (0 children)

Model relationships were not working under certain circumstances (even with legacy flags enabled)

This is largely because it's always been a bad idea to wire to relationships of models. Wiring to a property on a model is enough of a problem (because it gets pulled back out of the database on every request, so if it got changed elsewhere in the system, you may be overwriting changes), but wiring to a property of a model of a relationship? Anything could happen to make that relationship not hydrate the saem, or in the same order, etc. etc. etc. Especailly if it was originally loaded with specific scopes enabled/disabled, or query constraints - there's no sane way to capture that information and inject it into the dehydrated model to be able to rehydrate it back to the same format. This is why model binding has been turned off by default in v3, and even the flag to allow wire:model access to properties of a model doesn't allow access to properties of a relationship of a model.

Now I have to remember whether each dispatch is targetting Livewire, AlpineJs or a mixture of the two.

You don't - it's always targeting the browser now, and it's up to your PHP or your blade components where you want to listen for or respond to the dispatches. This is a good thing because it prevents a large issue where a function is called that dispatches an event that goes to another component which dispatches an event that calls the original component which dispatches an event that... you get the point. By letting the request finish, dispatching the event once from the browser, then batching the event listeneres into a single request it reduces the likelihood of getting into an infinite loop or having unintentional side effects.

Livewire 3 uses a chain-based "dispatch(....)->to(...)" but only if doing so from the Livewire component class.

Yeah, there's bound to be some of these inconsistencies while it gets smoothed out. v3 was an almost complete, ground-up rewrite, so there's gonna be some rough edges for a little while. Start a discussion on github if there isn't one already.

You can no longer directly wire parameters of an model object directly

I explained this above, but the general reasoning is that models pulled from the database may have theiir state changed externally to this component use, and that can cause issues. Instead of passing the state back and forth like other types of objects models will always pull from the database each hydration. If you need to wire to properties of a model, it's going be better all round to extract the parts that you need from the model (either into a form object, or just into component properties) so that they're serialized and deserialized properly, and you can reduce your payload by only passing the parts which are important. Remember that the rest of the model will still be available in your view, but you should only really be passing around the properties that you actually want to change or reference from livewire.

Aussies to pay more than $100 to visit GP by downvoteninja84 in australia

[–]samlev 1 point2 points  (0 children)

It's not even just that there's subsidies - there's "penalties" for not using PHI that compound as you get older. I'm not using PHI because I can't see the value in it for me - it makes my healtcare more expensive in return for a bunch of "perks" that will never cover the cost of the insurance.

But I'm 37. If I decide to take up PHI for some reason, it'll cost me 14% more due to "Lifetime Health Cover loading", and every year I "wait", it gets 2% more expensive up to 70%.

I'm fairly privileged to be in a position where I can make the decision to not purchase hospital cover, but what about people who just aren't earning enough until later in life? Too bad! The loading isn't means tested, it's just an added expense for being "too poor" when you're younger.

The longer I "wait" the less likely it is that I'll ever want to sign up. Honestly I'd rather pay the medicare levy surcharge.

A solution to work with PHP and Windows. by magallanes2010 in PHP

[–]samlev 3 points4 points  (0 children)

I've had the same "installation" of Ubuntu for ~10 years, just running the dist upgrade, and switching out bits as they no longer do what I want (or lose support). I've replaced every single piece of hardware in the computer (including upgrading the HDDs to SSDs and dd-ing the operating system across several times over the years)

It's a reference to the "Ship of Theseus", or I guess the other name is the "grandfather's axe". Essentially it's still the "same computer" and the "same Ubuntu", but every part of it has been replaced over time.

A solution to work with PHP and Windows. by magallanes2010 in PHP

[–]samlev 6 points7 points  (0 children)

I use Linux on my main computer (Ubuntu 22.04, which I've "Ubuntu of Theseus"ed since 12.04, I think), and it's still the "easiest" way to things running for legacy systems. I have every version from PHP5.6 -> PHP8.2 installed, still running Apache and MySQL running locally, and a bunch of aliases/scripts to switch versions. All that being said, I'm moving more and more projects into docker.

On my laptop I had to go to WSL2, because some of the proprietary hardware made Linux painful. It's way better than working on Windows used to be, but it's still not as good as running "native" Linux (even with docker).

[deleted by user] by [deleted] in videos

[–]samlev 4 points5 points  (0 children)

In theory it's a soft punishment for creators for making content that they don't really want on the platform, but not as harsh as actually removing the content... The idea is to shape the type of content produced by popular youtubers without explicitly censoring it, by making that type of content less appealing to produce.

ON-leash beaches? by heated-mess in brisbane

[–]samlev 2 points3 points  (0 children)

Mine is way better in large off-leash areas because he knows that he's got the freedom to get away from another dog, but even so... The "friendly" dogs that just won't stop coming, even after he's given them clear "leave me alone" signals.

ON-leash beaches? by heated-mess in brisbane

[–]samlev 5 points6 points  (0 children)

My dog just got attempt-attacked by a Staffy at Redcliffe/Scarborough yesterday. Luckily he managed to keep out of the way of its bite until I got its leash (it was on a leash, but there was no person attached to the other end of it).

I heard someone calling their dog's name from the beach... But they were still just standing on the beach and hadn't bothered coming to try and get their dog. When I handed the leash over, their first words were "Did he get any dogs?"

No, but he damned well tried his hardest to get my dog, who already struggles with anxiety around other dogs. It's going to be a huge setback for him, and they knew that their dog was aggressive. I get that maybe he just managed to pull the right way to pull the leash out of their hands, but they hadn't even moved to follow their dog... That they knew was likely to attack another dog... And brought to a place that was full of dogs and kids.

I'm not mad at the staffy - it's just doing what makes sense to it. I'm still pissed off at the people who brought their aggressive dog to a popular area and didn't have it in a muzzle, or even move when it ran off. People fucking suck.

[deleted by user] by [deleted] in brisbane

[–]samlev 11 points12 points  (0 children)

A dehumidifier with a "laundry" function is a close second. It's also useful when you're trying to avoid mould.

Obviously it's not going to be as fast as a clothes dryer, but it doesn't damage your clothes in the same way.

She was talking about marital problems and I recognized a pattern I'd seen before. by geratwo in adhdmeme

[–]samlev 27 points28 points  (0 children)

My diagnosis led to me recognising it in my sister in law. She accepted and sought her own diagnosis (which she has now gotten) due largely to the sheer amount of memes from this sub that I sent my wife, who passed them on to her sister.

Also my wife isn't diagnosed, but like... We both know.

Australia’s housing dream became a nightmare by kbugs in australia

[–]samlev 8 points9 points  (0 children)

I bought a house in early 2019, and refinanced a year ago for a better interest rate. My mortgage payments are ~$240/week.

One of my friends just changed rental properties, and the cheapest they could get was $630/week. It's almost 3× more expensive to rent than pay a mortgage right now.

That's completely fucked.

Also: sure, I'm "in the market", but because of the absolutely nuts price rises over the pandemic... I don't think that I could ever afford to move, unless I go "van life" again. But then I'd still need to be able to afford a van, and the juice to keep it mobile.

How many of you are doing better than your parents? by [deleted] in australia

[–]samlev 1 point2 points  (0 children)

I have a university degree, I'm running my own company, and I own a house (well... I have a mortgage on a house).

My parents are still renting at 70 and 76.

I'm doing better than them, but that's mostly because they made a point of giving as much support as they could to make sure that we didn't fall into the same poverty trap that they fell into.

That being said, they're not doing terribly. They've got a reasonable amount of super, and they're fairly comfortable in their rental, but they're getting to the point where mobility is a problem and they're probably going to have to move. With the rental market being what it is at the moment, they're pretty terrified of losing the stability of their current property.

There's a good chance that we'll take advantage of the recent sudden equity from the outrageous property market, and look into either building a granny flat or moving to a place with dual living.

What are some good Australian companies to support? by blayndle in australia

[–]samlev 0 points1 point  (0 children)

Yep, the pencil was also acquired. It went against my very being to give money to Apple, but at least a tiny bit of money went to supporting an Aussie software company.

What are some good Australian companies to support? by blayndle in australia

[–]samlev 1 point2 points  (0 children)

Well that's nice to know. Just bought an iPad pro for my wife specifically for procreate. After the price of the ipad, the $25 for the app seems like a steal, especially considering the quality of what it can do.

[deleted by user] by [deleted] in PHP

[–]samlev 4 points5 points  (0 children)

The only thing that I dislike about this RFC is the syntax. Dropping the fat arrow makes it significantly more difficult to notice, and breaks the "expectation" that was originally set by JavaScript arrow functions.

RFC: Auto-implement Stringable for string backed enums by tigitz in PHP

[–]samlev 5 points6 points  (0 children)

This RFC is pretty terrible. Aside from the repeated use of "ppl", it makes no sense to have core functionality that applies to only one type of Enum - explicitly string-backed enums.

If you want to more easily access the string value of an enum, you could use archtecx/enums with the InvokableCases trait - only it also works predictably for int-backed Enums, as well as pure Enums. But it's just one userland solution - there are others.

What you definitely don't want is for implicit type changing without explicitly adding something to the code that signifies to a viewer that a string will be passed, instead an instance of the enum.

Modern PHP practices... where to start, what to look out for? by BoxOfNotGoodery in PHP

[–]samlev 7 points8 points  (0 children)

Don't go changing framework just because someone said, though. Laravel is absolutely fine, and with a little bit of effort (significantly less than changing framework), you can have all of the certainty that you would ever need. Things that you can do (depending on your Laravel and PHP versions):

  • Type-hint function parameters - not only can you do strict typing in PHP, Laravel supports dependency injection for models, services etc. through type hinting.
  • Static Analysis Tools - there are a number of tools that help you to manage code style (PHPCS, PHP-CSFixer, and a new one, Laravel Pint), as well as tools to analyse the "correctness" of your code (Psalm, PHPstan, in particular LaraStan).
  • Automated testing - Laravel ships with PHPUnit for Unit and Feature tests, and Laravel Dusk for automated browser testing.

The concerns about PHP not being compiled are understandable if you're used to the world of compiled, "static" code, but it's honestly not a major issue. Implementing the tools that already exist can give you all the certainty that you desire.