Skip to content

u/hennell

In this archive from Jun 2008 to Nov 2026

62
posts
1k
comments
24
media
5.8k
score

It depends a little on if you're on Windows, Mac or Linux - for windows herd is a nice option, although I no longer trust beyond code not to just drop stuff at random so I wouldn't even then.

I tested out herd a while back but moved to ddev instead and couldn't be happier.

1 points

I used laragon on windows and phpmon for a long time, but yeah switching php would get annoying. Especially if you want xdebug or anything, making it work for one setup was always likely to break it for others.

Did some things with docker but always felt like I was fighting with it, and it was with older php versions that when I came back to the project the images would have gone and so I'd have to change it. I also like having proper local hostnames not localhost for every site, which was always a pain on docker.

Ddev however is a lovely system. It's one file to configure and it handles the rest of docker for you, plus gives you the hostnames, sets up common tools like xdebug and a database, adds mailpit for emails and has a load of extensions if you need common other things. Orbstack on mac, wsl on windows and it's pretty much the same developing on both platforms.

And in making it easier to have different php versions for different sites, it's actually easier to upgrade them too. Change to a new php, upgrade composer dependencies, run rector to fix the common issues and fix any tests and then it's just testing anything you might be worried about not tested.

Especially with the PHPstorm ddev plugin, it is very nice to use.

3 points

Pro tip - set the 403s as 404s as an env setting. It's annoying in local dev or test debugging!

For high level security situations or complex websites though, returning a 404 isn't entirely enough to hide the presence. A true 404 only has to realise the requested record doesn't exist. An aliased 403 collects the record, collects permissions, checks policies etc before returning the 404. Mapping out response times you can work out which 404s are doing more work which can reveal which are the 403s.

But wrap the lookup in laravels Illuminate\Support\Timebox helper and you can set a minimum time for the request to take, disguising any variation in work load and removing the data leak.

2 points

You should look at adding rector to your setup - the PHP version sets convert stuff like that to new syntax automatically and quickly audits new code. Only seeing issues like that in live deprecation logs is more of an issue then the code.

4 points

DIP doesn't fix circular dependencies, nothing but breaking the circle does. If service needs a worker, but worker needs a service you are stuck. Either one of them must go without, or one of them must parent the other, e.g service makes a worker, who's service is itself. Although that means service must be capable of existing in some way without a worker to be passed to the worker.

I'm not clear if you caught this in testing or prod? If you don't have tests, learn that. If you do look at phpstan as that can flag all sorts of issues like this. There's even some custom rules for modular design that can pick up circular dependencies that might have spotted this directly.

also if you're doing modules setup deptrac - you can specify which modules can use which other modules so its easier to spot when you're breaking down the intended walls.

1 points

Yeah, it was a more technical wonder - I assume there is a lot more complexity to indexing then I'd care to consider, but it feels like it should be universally helpful that way round. I've been caught out by obvious looking 'improvements' like that in the past though - totally get your testing procedure!

Hope this all gets you some great ideas though. PHPStorm to me is a great program that suffers from the classic 'it's got all these features I don't need' issue, where every user complains they use a different 40% of the features! 😆

2 points

This looks pretty cool, although I can't tell if it's removed any features, or just doesn't activate specific features until you need them?

I do wonder why why things like:

Smarter indexing order — your PHP source files are indexed first and vendor/ last, so code intelligence in your own code lights up sooner.

isn't default already though? Seems pretty sensible.

(I'd also have thought you could just not re-index vendor at all unless composer.lock has changed but maybe that happens anyway?)

1 points

Have you read the discussions? The idea "this is it for generics forever" is silly - there were a number of voters keen on generics, but either don't like the erased approach in general, or felt this specific implementation had issues.

Larry Garfield's comment on why bringing the RFC to a vote seemed premature is worth reading, and he outlines a reasonable idea for how an enforced-generics RFC could come about.

9 points

Yeah, I've bought quite a bit from them in the past, but don't anymore. If it doesn't take off huge it won't get any updates as they move on to the next thing.

The ai world is so volatile right now I've no idea if this would even be useful in a year, but even less idea if beyondcode will still support it.

2 points

I was looking at doing a project like this recently, but wasn't totally clear from the docs - is the idea that you generate and store the embeddings in a local postgres db, then offer that as a tool to the ai provider to query? Is laravel making the embeddings and searching or using the ai provider?

I've got a laravel app with a load of uploaded PDFs which I can do a basic search on, but I'd like to test an AI search and see how that compares. I've tried a few platforms for a POC, but want to be able to hook it to the laravel app metadata and get a source of "X.pdf -> page 18 " which most things don't seem able to do page results (My current search is basic text match but it does show page and snippet!).

0 points

It's worth reading their previous post as well, as a lot of this is part of a concentrated effort to improve the security of composer and risk of supply chain attacks. It won't protect from everything - packages are always someone elses code, but it should reduce the chances of package take overs and protect you better if a package is found to be malicious.

If you've got a package on packagist make sure mfa is on on your account, check your GitHub settings are secure as well, and archive things you're not maintaining!

7 points

It's a third party package - basically a collection of user submitted translations for laravel. So you can do artisan lang:add de and it'll add a load of translation strings used by laravel/fortify/breeze/jetstream etc. Will also do things like http status translations, validation strings and others.

Quite handy for a multi language setup, gets you a lot of transitions added instantly, and updated when the framework updates / changes things.

I thought it was a require-dev package though, that typically isn't run in production, but their guide doesn't suggest that.

12 points

I'm saying they're two quite different issues with very different average level of user, impact and availability to exploit. And indeed a difference in what you might get from compromising them. I'm glad you also agree there's a difference, feel free to add that to the person I was responding to.

1 points

Conceptually it's similar, but practically it has some big differences.

Composer is run by developers, usually has to be integrated into your code to do anything, you'd need a very poorly configured server to access the files directly and it usually goes through some sort of peer review before being deployed.

WordPress plugins can be installed by anyone with permission, can hook into almost anything WP, doesn't take much to accidently expose their files publicly and are live as soon as the user decides.

You can lock plugins down, you can mess packages up - they are both dangerous, but one makes it much easier to make mistakes than the other - and gives that ability to people less aware of the landmines they're waking through.

4 points

I'm using ddev on top of docker which has the handy feature of `ddev xdebug` and `ddev xdebug off` to toggle the setting. Can probably look at how they did that and replicate something similar.

To be honest though I don't often have it on. I give phpstorm the .so file location it can use when running tests in debug mode and when generating coverage without it needing to be enabled globally. Covers most of my usage, and encourages adding a new test to solve a problem over manual testing!

1 points

Yeah but that just hides the problem. And it's annoying running locally, you do something then the tests fail but it's just an unconnected issue. But you don't want to fix it when it has nothing to do with the current task so you run again and don't make a note of failed tests.

(Much of this was my own fault, I got a bit caught up in laravel factories for a while and just faker'd almost everything for tests. Most of the fixing was either hard coding test values or adding unique() to people / company names so if you were testing person A was visible and person B was not it didn't fail when they were made with the same name!)

But there were also some real bugs where things didn't work at 0 values and the test just picked a random number between 0 and 100, and one which didn't work when two values matched -- which was checked with tests using two numbers from rand(0,100). I think that only surfaced at the end when I ran with --repeat=400 just for 'fun'. (I then searched all tests for use of rand() to ensure there was no other madness!)

2 points

rector and phpstan spring to mind, but I don't know if I would call them 'cheap' as you have to do a bit of setup still. In general adding typehints has caught a lot of stuff, adding them as you go is a very cheap win IMO.

Biggest bang for my buck recently was realising you can run phpunit multiple times. `--repeat=100` runs the suite 100 times. So flakey tests that fail >1/100 times get surfaced and you can make a clear effort to fix them.

7 points

It's not a php vulnerability, it's just what they call it - "a php implementation of the copy fail vulnerability". In theory it means that a package could abuse this or some exploit where a user php code is run could escalate (you have other problems here admittedly!)

I'd agree that ffi rather than limits it's practical use, but seeing there is a PoC that runs in php does make it seem more urgent given if you're here, your probably running php...

1 points

This is some very good analysis. I was exploring modular recently as I'm setting up a new modular filament app and the docs recommend it. Felt a lot harder to get it going, compared to laravel-modules which has way more docs and guides on making it work. Did wonder about the performance but it's nice to see it probably doesn't matter!

(although my current issue is that with routes cached, the filament routes do not exist. I'm trying to have a dedicated panel per module, but only the main panel seems to load when routes are cached. Haven't worked out how to fix that without just disabling route caching yet!)

2 points

I rather like the low config approach, makes it much clearer what you've changed from the default. Things like configuring the cache prefix you find out you can configure when you need that functionality.

It also means if they rename and add stuff you don't have to merge old configs with new and work out what is something you've changed and what is the new default. It does seem easier.

That said I haven't updated old systems to the new way. I don't use shift so it's easier to leave it unless I do a full new-framework rebuild.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.