Laravel Value Objects is a fantastic package that offers a bunch of general-purpose value objects you can use in your Laravel application. You can generate custom value objects with the Artisan command: php artisan make:value-object YourNameValueObject Boolean $bool = new Boolean('1'); $bool = Boolean::make('1'); $bool = Boolean::from('1'); $bool->value(); // true (string) $bool; // 'true' $bool->toArray(); // ['true']

Text $text = new Text('Lorem Ipsum is simply dummy text.'); $text = Text::make('Lorem Ipsum is simply dummy text.'); $text = Text::from('Lorem Ipsum is simply dummy text.'); $text->value(); // 'Lorem Ipsum is simply dummy text.' (string) $text; // 'Lorem Ipsum is simply dummy text.'
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners