Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ class JobsController extends \BaseController {

Notice how we are representing the user's instruction (or command) as a readable class: `PostJobListingCommand`. The `execute` method will expect the command's class path, as a string. Above, we're using the helpful `PostJobListingCommand::class` to fetch this. Alternatively, you could manually write out the path as a string.

You can pass, if you like, the data in an associative array as an second argument:

```php
$this->execute(PostJobListingCommand::class, [
'title' => $jobTitle,
'description' => $description
]);
```

### The Command DTO

Pretty simply, huh? We make a command to represent the instruction, and then we throw that command into a command bus.
Expand Down