class TestCast implements CastsAttributes
{
public function get($model, string $key, $value, array $attributes)
{
return new Product();
}
public function set($model, string $key, $value, array $attributes)
{
dd('Run');
}
}
$product = Product::query()->first();
dd($product->price, $product->price);
protected $casts = [
'price' => TestCast::class,
];
db_1 | 2023-02-24 12:56:58.077 UTC [3243800] DETAIL: Process 3243800 waits for ShareLock on transaction 32998866; blocked by process 3243801.
db_1 | Process 3243801 waits for ShareLock on transaction 32998865; blocked by process 3243799.
db_1 | Process 3243799 waits for ExclusiveLock on tuple (170620,1) of relation 24019 of database 23678; blocked by process 3243800.
db_1 | Process 3243800: update "notifications" set "is_read" = $1, "updated_at" = $2 where "client_id" = $3
db_1 | Process 3243801: update "notifications" set "is_read" = $1, "updated_at" = $2 where "client_id" = $3
db_1 | Process 3243799: update "notifications" set "is_read" = $1, "updated_at" = $2 where "client_id" = $3