{"repo":"michael-rubel/laravel-value-objects","free":true,"listed":false,"github":"https://github.com/michael-rubel/laravel-value-objects","clone":"git clone https://github.com/michael-rubel/laravel-value-objects.git","description":"A bunch of general-purpose value objects you can use in your Laravel application.","language":"PHP","stars":205,"topics":["laravel","looking-for-contributors","php","value-object","value-objects"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Value Objects A bunch of general-purpose value objects you can use in your Laravel application. --- The package requires PHP 8.1 or higher and Laravel 10 or higher. #StandWithUkraine Installation Install the package using composer: Built-in value objects - Boolean - ClassString - Email - FullName - Name - Number - Phone - TaxNumber - Text - Url - Uuid Artisan command You can generate custom value objects with Artisan command: Usage Boolean --- Number --- Text --- ClassString --- Email --- FullName --- Name --- Phone --- TaxNumber --- Url --- Uuid Handle failed validation If you want to avoid try/catching your value object when the validation fails, you can use makeOrNull method: Extending functionality All value objects are Macroable. This way you can add new methods dynamically. If you need to extend existing methods, you can create a value object locally with make:value-object command and use inheritance. For example: Conditionable Value objects utilize a Conditionable trait. You can use when and unless methods. Contributing If you see any way we can improve the package, or maybe you want to make your own custom value object as built-in, PRs are welcome. Testing License The MIT License (MIT). Please see License File for more information.","default_branch":null,"files":null,"tree":[],"storefront":"/r/michael-rubel","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/michael-rubel/laravel-value-objects/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}