The Pest docs are great so I would start there. Spatie also has a good course that covers testing with Pest: spatie.be/products/testing-laravel
In response to @FinalAsgard
In response to @MrPunyapal
Just saved the thread to Readwise and will read soon, thanks!
I wrote a post about using a DTO to keep your JSON columns structured in #laravel. Learn about how to cast a JSON column in an Eloquent model to a DTO.
seankegel.com/laravel-casting-eloquent-json-fields
In response to @moisish
I plan to build my own at some point, but right now I’ve been using Hashnode which has been good. I might still use it in headless mode when I build my own.
In response to @skegel
Some examples:
/**
* @param MyObject[] myArray
*/
public function withArray(array $myArray)
{
//
}
/**
* @param MyObject[] myArray
*/
public function withIterable(iterable $myIterable)
{
// Using iterable will support both arrays or Laravel collections.
// However, you may need to use the spread operator to convert
// back to array if needed.
$array = [...$myIterable];
}
/**
* @param Collection<MyObject> myArray
*/
public function withIterable(Collection $myCollection)
{
// This gives all the power of collections which is great,
// however, it requires Laravel collections so not as useful
// outside a Laravel application.
}
•