Cast
use Carbon\CarbonImmutable;
use Illuminate\Database\Eloquent\Model;
use WendellAdriel\Lift\Attributes\Cast;
use WendellAdriel\Lift\Lift;
final class Product extends Model
{
use Lift;
public string $name;
#[Cast('float')]
public float $price;
#[Cast('int')]
public int $category_id;
#[Cast('boolean')]
public bool $is_active;
#[Cast('immutable_datetime')]
public CarbonImmutable $promotion_expires_at;
#[Cast('array')]
public ?array $json_column;
}castAndCreate
castAndFill
castAndSet
castAndUpdate
Last updated