Gitamin\Handlers\Commands\Issue\AddIssueCommandHandler::handle PHP Method

handle() public method

Handle the add isssue command.
public handle ( AddIssueCommand $command ) : Issue
$command Gitamin\Commands\Issue\AddIssueCommand
return Gitamin\Models\Issue
    public function handle(AddIssueCommand $command)
    {
        $data = ['author_id' => $command->authorId, 'project_id' => $command->projectId, 'title' => $command->title, 'description' => $command->description, 'created_at' => Carbon::now()->toDateTimeString()];
        // Create the issue
        $issue = Issue::create($data);
        return $issue;
    }
AddIssueCommandHandler