Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit 8144c21

Browse files
authored
Merge pull request #12 from speccode/master
RespondWithViewJob.php
2 parents 46257c9 + 20d13e6 commit 8144c21

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Domains\Http\Jobs;
4+
5+
use Lucid\Foundation\Job;
6+
use Illuminate\Routing\ResponseFactory;
7+
8+
class RespondWithViewJob extends Job
9+
{
10+
protected $status;
11+
protected $data;
12+
protected $headers;
13+
protected $template;
14+
15+
public function __construct($template, $data = [], $status = 200, array $headers = [])
16+
{
17+
$this->template = $template;
18+
$this->data = $data;
19+
$this->status = $status;
20+
$this->headers = $headers;
21+
}
22+
23+
public function handle(ResponseFactory $factory)
24+
{
25+
return $factory->view($this->template, $this->data, $this->status, $this->headers);
26+
}
27+
}

0 commit comments

Comments
 (0)