
This is a silly one.
I wanted to run Laravel in dev mode but using the compiled js and scss from npm run build
via vitejs.
This usually works
but for some reason Laravel was trying to serve js/css from http://localhost:5173/@vite/client
a service I usually run - but I wanted to test the build stuff.
The solution is really simple but not well documented.
Read more ...Laravel Validation supports rules forcing unique values - but exceptions are usually needed.
For example if you have articles on a site where each has a slug that has to be unique - when you update the article it has to possible to save the article using the slug it already has.
https://laravel.com/docs/10.x/validation#rule-unique

Read more ...I have a Laravel project using vite InertiaJS and React
A unit test calling the Head module from @inertiajs/react
Was triggering this error
Cannot read properties of undefined (reading 'createProvider')
For this test I don’t really care about the Head module - but didn’t want to try and mock the whole of inertia-react
Read more ...For some reason I always seem to struggle getting code coverage reports picked up by SonarQube - the documentation isn’t bad but it seems to take me a while to find the right incantation .
I wanted both my PhpUnit tests and Javascript unit tests for my laravel project to generate coverage reports and import this to SonarQube.
Read more ...
The Laravel Docs have a section Constraining Eager Loads
Which hides a lot of power available to you while loading relationships.
It can be used for more than just “constraints”
If you want to sort your relations by a specific fields, add a count of a nested relationship, or in other ways add to teh query - this is where you can do it.
Read more ...