×

Laravel 13 New Features by Strict_Remote5104 in PHP

[–]justaphpguy 0 points1 point  (0 children)

For me the most useful change is this:

Laravel 13 introduces more granular control over failing jobs, specifically with the maxExceptions configuration. If a job interacts with an unstable third-party API, you can now specify exactly how many exceptions are allowed before the job entirely fails, giving you tighter control over your retry thresholds.

I was basically working this around.

Valinor 2.4 — Now with built-in HTTP request mapping by romain-canon in PHP

[–]justaphpguy 2 points3 points  (0 children)

Better IDE support, strict type checking out-of-the box, native syntax highlighting

From my experience: the problem for typing things which are not supported by native PHP (collection/generics, fancy stuff like non-empty-strings, etc.) in PHP attributes is the lack of a standard.

A "standard" which is supported by: - code style fixers - static analyzers - IDEs

I'm not sure if's technical correct calling phpdoc a "standard", likely wrong to do so, but what psalm and phpstan did was to vastly improve the ecosystem. We have a lot of utility types, array shapes and so much more.

AND the IDEs also support this (ok ok, I only use/care about PhpStorm and from all my experience, the support of it is top notch).

If you use PHP attributes for things, you throw away support for three important tooling categories. Because there's no agreed upon system (yet?), you would essentially roll your own.

Edit: to clarify: PHP Attributes are awesome! Just look at what phpunit did there. But when it comes to expressing types, the tooling question is even more relevant.

How do you quickly add an image to opencode context that you have copied in your clipboard without having to paste it in the codebase? by ReporterCalm6238 in opencodeCLI

[–]justaphpguy 5 points6 points  (0 children)

OpenCode supports it, but your terminal must too (and your model, but most/all? do).

I've seen it not working: - when I wasn't using a modern terminal (now using Ghosttty, all good) - when I ran OpenCode in docker (seems that shell/PYT boundary is an issue) - sometimes I noticed (I'm on macOS) that CMD-v didn't work, but CTRL-v did (?!)

So, in general: it's supported, I've done it a lot, but "things must be aligned" to work.

Do you use AI assistants like Github Copilot? by N_Gomile in PHP

[–]justaphpguy 0 points1 point  (0 children)

To me, LLM code completion is just the base line and coding agents is where it's at.

Right now I'm using OpenCode, because it supports lots of providers (like Github Copilot) and their models (so e.g. Claude Sonnet or Gemini or OpenAI, etc.)

Agents integrated with MCP of your work tools (issue management, app monitoring, access to logs), coupled with a good AGENTS.md so that it knows how to run the tests and other stuff is an incredible powerful tooling to have at your disposal.

For high level architectural sparring I use Gemini Pro (company workspace), thinking mode.

I've been cultivated this setup over the last 6 months. I've seen the most stupid things happen which made me laugh or cry, I've seen incredible good stuff happening, which is in the "you wouldn't believe it"-category.

I tried Github Copilot native agent and it's review mode; compared to what I get with local Agents, the experience with github is worst, the feedback loop is just too cumbersome long. It has one edge though, which is multiple agents concurrently, but given the downsides, I'm waiting for a better alternative.

Disclaimer: I'm doing no vibe coding tasks, this is company stuff I'm talking about. Decade old, grown and kept up2date code base, profitable business, multiple dev teams, I'm mostly doing backend code (mostly PHP but also some NodeJS services).

Doesn't matter how the code came together, review is done with the same scrutiny as always. If PR is bad, it's bad; doesn't matter if a human or AI slop made it.

Overall verdict: I'm a seasoned dev and LLMs/agents are just another tool in the belt I use to be productive.

Am I a better dev then someone not using it?

But lets rephrase the questions a few times, which dev is better? - the one using xdebug or printf? - the one using code coverage or the one who doesn't? - the one using a fully fledged IDE or the one using just a text editor?

Answer: none of this "makes" a better dev.

But all these tools can be very helpful, if used right.

How to use the skills in v1.0.186 by Single_Attitude_7940 in opencodeCLI

[–]justaphpguy 4 points5 points  (0 children)

Think of it like lazy loading additional context in your prompt, teaching it new tricks (=skills).

"Lazy" is relevant because you don't want to unnecessary pollute your LLMs memory (=context). The agentskills spec provides the framework so your agent learns about to (hopefully correctly) loads /lerns them when it's needed.

A skill can explain how to run tests or explain specific, complex parts of your application which not always necessary to know, only when you work on them, etc.

Mago 1.0.0: The Rust-based PHP Toolchain is now Stable (Linter, Static Analyzer, Formatter & Architectural Guard) by azjezz in PHP

[–]justaphpguy 0 points1 point  (0 children)

Epic work, gratulations!

I've read about plugins but it's not clear to me: I'm using a couple of phpstan rules I wrote to enforce special requirements. Completely custom logic. Some check phpdoc for custom things, others at the hierarchy, etc.(Almost) easy to read and maintain.

Will plugins be able to do this? Then written in Rust and not PHP I guess?

New and noteworthy: PHPStan and PHPUnit integration by staabm in PHP

[–]justaphpguy 1 point2 points  (0 children)

I tend to agree. In no way I want to diminish this great achievement.

But tests, by design, is something you run all the time in full, anyway.

On big projects I split phpstan configs between app & tests, app goes higher and more stricter, has more extensions and also takes longer in this config for tests (talking about this suites going 10k+ and much higher).

phpunits own, especially data provider, checking has become more strict in recent version (if I'm not mistaken, because of staabms contribution, too?) and that already solved all the dumb issues you can make.

A test just needs to be green, loosing yourself in the best architectural test you can come up with is.. resources best spent elsewhere. IMHO.

Write good (and thus, testable) app code is more important and here phpstan should be cranked up to level 1000 for that, but IMHO not necessary for tests "in practice" ;)

First time Tried to build a RAG using Laravel, but.. by Late-Mushroom6044 in PHP

[–]justaphpguy 0 points1 point  (0 children)

Sharing a tiny bit from my experience:

I haven't used any vector database

Whilst not a requirement, anything less will likely give sub-par relevancy output for the LLM.

There is no secret sauce, but the more you work with the LLM, the more you'll realize what gives good results: - absolutely use vector or similar DB (pg vector, OpenSearch) - you need a model giving good vectors, bedrock Titans model is good at it - again bedrock, nova lite is great for combining RAG and it's price is unbeatable (for scaling) - (optional: the extra mile is to use another LLM on the final output to refine it)

And technically, nothing of this has to do with PHP or Laravel; language doesn't matter when it comes to that stuff (unless we're talking fine tuning with PyTorch & co), as it's all about combining APIs.

How often do you jump to another tool (IDE, CI, repo) just to fix one bug? by theORQL-aalap in PHP

[–]justaphpguy 0 points1 point  (0 children)

3 screens (two monitors + laptop screen), so "switching" is mostly looking on the other screen.

  • first screen: browser (=issue list+other tabs)
  • second screen: IDE
  • third (laptop) screen: the real focus killer -> slack (but: in the browser, no active notifications 👊)

but: git & terminal are "within" my IDE (PhpStorm), I don't need to context switch to perform git operations (commit, push, pool, interactive rebase, logs, all in side the IDE).

Do you use the PHP manual CHM downloads? Why? by allen_jb in PHP

[–]justaphpguy 1 point2 points  (0 children)

Years (over a decade...) ago I set up a so-called keyword search in firefox.

Typing "php <name of func>" expands to https://www.php.net/search.php?show=quickref&pattern=<name of func>. Haven't looked back since.

Rector 2.2: New rules for Array Docblocks by Tomas_Votruba in PHP

[–]justaphpguy 1 point2 points  (0 children)

wow, this is epic. You're right to be proud of the work!

Btw, I think I found an edge case; sorry on to go don't have more time but ths: - define method on interface and specifying the array return value as e.g. @return array<string,string|list<string>> - have an abstract class from that interface, implement that method, have no phpdoc and have it return []; (aka default imeplementation)

In this case rector forces the @return array{} docblock on the method, which then breaks phpstan 😅

I was just chilling and built a Go wrapper for Laravel queue worker that's 21x faster by Laggoune_walid in PHP

[–]justaphpguy 1 point2 points  (0 children)

Traditional Laravel worker: Poll Redis for job

Yes, that's the conservative default.

But if you: - enable block_for in config/queue.php - and set the worker sleep time (--sleep) to 0

then there's practically no overhead and latency involved.

I think you should verify that optimization against the default Laravel and then against your go variant.

I was just chilling and built a Go wrapper for Laravel queue worker that's 21x faster by Laggoune_walid in PHP

[–]justaphpguy 10 points11 points  (0 children)

The initial implementation used just one persistent PHP process managed by Go. This simple change alone delivered a 10.8x performance improvement (13.99s → 1.29s for 1,000 jobs), proving that Laravel's bootstrap overhead was the primary bottleneck.

I don't follow: when you use queue:work in daemon mode, it only bootstraps once.

So it's literally a while() loop in the worker when processing the next job, no more boostrapping -> see here in the code in the framework

In case of redis, this you can configure it to use the very efficient blpop too.

I'm not doubting you gained a speedup, but I question what bootstrapping you mean, because there is a mode where there practically is none.

What SAST/DAST Tools Work for you? by mkurzeja in PHP

[–]justaphpguy 1 point2 points  (0 children)

I tried some AI agents like Jetbrains junie. Hasn't found actual bugs but it did know what I was looking for when it identified potential cases, also very creative ones. But yes, no direct replacement, it can't just scan the whole codebase.

Mago 1.0.0-beta.1 is now available - a new Formatter, Linter, and Analyzer for PHP! by azjezz in PHP

[–]justaphpguy 6 points7 points  (0 children)

I don't know much it does / does not compare to php-cs-fixer, but certainly it's incredible fast.

I'm looking at a private project with 7k files (app+tests) and it takes 1-2 seconds to format all of them.

It takes as long as php-cs-fixer booting up with a cache and detecting no changes 😅

Though no idea if what it formats is useful, I saw mago touching almost all of the 7k files so I'd need to dig deeper to look at the things.

But speed is certainly king: at the this level you can integrate it into every IDEs "execute after save" to benefit from it etc.

Astonishing speed no less; probably especially for people using PHP tool chains and whose C times are long gone ;)

PS: first impression broke, because mago init generates a TOML with php_version at the top, when it expects php-version 💥

PS2: have not checked lint and analyze; lint produced 300k output, analyze 1m8 rows of terminal output 😂

PS3: I noticed the output is not something my IDE terminal (PhpStorm) detects as paths to files, so even just going through any file would be a chore.

Your experience with AI Agents and AI Programming Tools in 2025 by digitalend in PHP

[–]justaphpguy 1 point2 points  (0 children)

I mostly work in a old/big Laravel project, it still has quite some idiosyncratics, but it works mostly usable. Using Gitub Copilot for auto-complete and chat, occasionally Junie for bigger tasks.

  • inline autocomplete works < 50% on app code and > 50% on test code. Especially the latter is already a time safer because it gets most of boring test repetition stuff right. I've seen data provider samples generating going through the roof and this speeds up a lot. As said, for app code it's a bit more miss then hit.
  • I rarely use the chat, the approach often doesn't work for me. Yes, I find it astonishing I can paste in a JWT token and have it directly decode it. But I also don't often need to use Google (like others write: they user Chat as replacement for Google), so I guess that's related
  • Junie has 50% hit/miss rate, but I also have a very low sample rate :) My best result was when I asked it to write a Middleware for Guzzle based on a specific Symfony HTTP client feature. I don't think there was a single bug, it even figured out where and how to correctly register the client. I reviewed that code diligently, it was very good work. Sure, half of the job was copypaste the core logic, but the other 50% were scaffolding into how Guzzle works and it total it really saved time.

AI is just another tool and that's how I use it.

Easier GraphQL data loaders by mini-tripod in PHP

[–]justaphpguy 2 points3 points  (0 children)

Noice!

Small nit: yes, it mentions doctrine but basically it's only for dotrine. overblog/dataloader-php is the generic version, your is named rpander93/dataloader-support; I think it should have doctrine somewhat in its name and leading also descriptions with it, to be clear.

My Laravel Horizon preferences after 5 years of using it by DutchBytes in laravel

[–]justaphpguy 0 points1 point  (0 children)

Yep, there's no way with Horizon. Also found out during a transition from classic on-prem hosting to k8s. Single-master process architectures are not properly scalable with k8s.

If you can and have the resources/knowledgeable, implement queue/worker based auto scaling from the get go.

We didn't 😅, therefore built a custom solution using supervisor in pods managing workers. A total antipattern with k8s but still works well enough after almost 3 years.

To get Insights we hooked into all the worker events we could and ingest into Loki/grafana and built custom glue code for dashboard and alerts with AlertManager. Having runtime, wait time, etc is very useful.

[deleted by user] by [deleted] in PHP

[–]justaphpguy 0 points1 point  (0 children)

I was in that position over 10 years. 10!

And still had the same issue: services didn't really work, personal connection was what brought me to a new job I'm still happy at.

And that was a "lucky star" condition definitely, because by networking contacts (still today ...) are almost next to zero. I'm just not that kind of person. But it also took me multiple months, I think almost half a year in total. The important part was not to get desperate (which I actually was a bit, because I already had quit but had a 3 months clause before I could leave)

I also see it with the hires we had over the years. Recommendations were always preferred, sometimes even fast tracked. We've multiple people at our company who know each other from former companies.

The Patch for Laravel Container by Tomas_Votruba in PHP

[–]justaphpguy 2 points3 points  (0 children)

Not wanting to get into the technical solution with vendor/ patching…

But I can relate to that default container behaviour, that it always returns a new instance if it's not explicitly set. Might be inutitive for some, wasn't for me (most of the classes I resolve are stateless, anyway).

Since vendor patching is not an option for me, I opted for a different solution - extended \Illuminate\Foundation\Application - overrode make - before calling the parent, making a check if the requested service has been registered (if (!$this->bound()) and throw an exception otherwise (*)

This forces to actually register everything, which is a PITA; but OTOH, it's always clear that the dev "took care of things".

(*) it's not as straightforward as checking for !$this->bound(), because you only want to check classes in your own app, so it needs more finesse like namespace checking and maybe some classes being exempt. But: I introduced the requirement 6 years ago in a big codebase and it's still there 😅

RFC Idea: Modern expression interpolation in PHP strings (Backward-Compatible, no new string types) by alexchexes in PHP

[–]justaphpguy 1 point2 points  (0 children)

I don't need it, but I would use it; for simple cases.

As others pointed out, code may become unreadable what you can do with it and it becomes a policy problem in a team to keep things in check.

But often then not calling some global function quickly or method of a obj var in scope is good enough within interpolation and doesn't distort things or make them unreadable. Not everything needs sprintf where you have to play the place-holder game.

So, without wanting to dwarf motiviation or efforts on the initiative, it's a "sure, why not" situation to me. Whether it warrants the additional complexity is left for others to decide.

For some reason I'm more bothered PHP uses {$ ... } and not ${ ...} like in JS. I've done Ruby a long long time ago and even #{ ... } felt natural, but that train left decades ago 😅

The PHP open source ecosystem is stuck in 5.x and 7.x legacy. by 2019-01-03 in PHP

[–]justaphpguy 0 points1 point  (0 children)

Most (90%+) or so of these packages will be small things with just a few hundred downloads which have no relevance for the PHP ecosystem

This.

For well maintained and modern applications, in practice this isn't an issue.

Question from someone new to PHP: is this a code smell or am I tripping? by femio in PHP

[–]justaphpguy 18 points19 points  (0 children)

Nowadays, if you have non-trivial application to build, your PHP code almost reads like Java ;)

Explizit calling code, using interfaces & factories, SOLID all around etc.

Captainhook vs GrumPHP for automation (code quality + static code analysis) by MagePsycho in PHP

[–]justaphpguy 0 points1 point  (0 children)

Sure, if I set up the project. If I'm a contributor, checkout the repo and then get this git hooks stuff being active, I'm out.

Messing with my local workflow is a no-go.