1. Go to this page and download the library: Download php-collective/dto library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-collective / dto example snippets
// config/dto.php
use PhpCollective\Dto\Config\Dto;
use PhpCollective\Dto\Config\Field;
use PhpCollective\Dto\Config\Schema;
return Schema::create()
->dto(Dto::create('Car')->fields(
Field::string('color'),
Field::dto('owner', 'Owner'),
))
->dto(Dto::create('Owner')->fields(
Field::string('name'),
))
->toArray();