1. Go to this page and download the library: Download r4nkt/laravel-dto-action 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/ */
r4nkt / laravel-dto-action example snippets
$data = [
'email' => '[email protected]',
'list' => $emailList,
'attributes' => $attributes,
'confirm' => false,
'send_welcome_mail' => false,
];
// create the DTO for the CreateSubscriber action and then execute the action
CreateSubscriber::dto($data)->execute();
php
use R4nkt\LaravelDtoAction\Action;
class CreateSubscriber extends Action
{
public function __invoke(CreateSubscriberDto $dto)
{
// code to perform action, using $dto as needed...
}
// supporting methods, if needed...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.