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 ...I am working on a project that makes use React within Laravel.
I didn’t find much support for setting up React tests.
So here are som notes on how I got it working.
Read more ...I needed to send password reset emails from Laravel with additional data so that depending on how the password reset is triggered the email content varies.
Read more ...You may not need this, if you can manage multiple types of user via roles and permissions it will be much the simpler route to follow.
In my case I wanted user with different: properties, relationships, routes, password rules, timeouts, and more.
It was worth the pain of setting up two authenticatable models.
Laravel is very flexible and well documented, but the further you stray from what most people do - the less obvious it is and a few of these steps took me a while to figure out.
Read more ...I am working on an application that needs to be able to login to a Laravel instance via API.
In my usual workflow all the session management and XSRF protection has been automagical but I needed to be able to build a test case - and all the docs seemed to assume it would “Just Work™”
Read more ...I’m a long time Linux user, and a big fan of Docker, Kubernetes, VMs, and containers.
While I love developing on Linux - I do sometimes find it frustrating that I don’t have the same level of access to the Microsoft suite on Linux.
A while ago I had to use a Windows laptop for a few days and tried out using WSL - so most of the time I’m in Linux - I didn’t entirely hate it so when it was time for an upgrade I decided to try the Windows route this time.
I’ve had my new machine for a little over a week now.
Read more ...Kubernetes provides a wide variety of methods for formatting output
The custom columns output lets you print multiple values defined using jsonpath expressions in a tabular output
While outputting scalar values is reasonably intuitive, I couldn’t see in the docs where is says what the format for defining custom-columns is.
Read more ...If you have multiple account with Gitlab or Github you will find that you can’t use teh same ssh key for both accounts.
The nicest way I have found of configuring this is by putting the different projects in a subfolder - and then using a gitconfig conditional include
Read more ...InertiaJs does a great job of helping me build React apps on Laravel. The form help does a great job - especially with displaying validation messages.
But I couldn’t figure out how to change data and save the form in one action.
Read more ...The Laravel database validation rules are more powerful and flexible than I realised at first.
Looking at the Available Validation Rules we can see that Exists and Unique both have the suffix (Database)
This is because the both implement the DatabaseRule trait which offers more power than might be expected.
Read more ...