You are viewing the documentation for an older version of this package. You can check the version you are using with the following command:
composer show spatie/laravel-data
Optional properties
Sometimes you have a data object with properties which shouldn't always be set, for example in a partial API update where you only want to update certain fields. In this case you can make a property Optional as such: