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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners