v2 first commit
This commit is contained in:
37
app/Jobs/Common/UpdateReport.php
Normal file
37
app/Jobs/Common/UpdateReport.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Common;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Models\Common\Report;
|
||||
|
||||
class UpdateReport extends Job
|
||||
{
|
||||
protected $report;
|
||||
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param $report
|
||||
* @param $request
|
||||
*/
|
||||
public function __construct($report, $request)
|
||||
{
|
||||
$this->report = $report;
|
||||
$this->request = $this->getRequestInstance($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return Report
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->report->update($this->request->all());
|
||||
|
||||
return $this->report;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user