Created
June 8, 2016 21:09
-
-
Save Mulkave/bd293944af0a60d6be487bfd2e03a808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Directory\Domains\Http\Jobs; | |
use Directory\Foundation\AbstractJob; | |
use Illuminate\Routing\ResponseFactory; | |
class RespondWithJsonJob extends AbstractJob | |
{ | |
private $content; | |
private $status; | |
private $headers; | |
private $options; | |
public function __construct($content, $status = 200, array $headers = [], $options = 0) | |
{ | |
$this->content = $content; | |
$this->status = $status; | |
$this->headers = $headers; | |
$this->options = $options; | |
} | |
public function handle(ResponseFactory $response) | |
{ | |
return $response->json($this->content, $this->status, $this->headers, $this->options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment