for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Distilleries\Expendable\Exports;
use Carbon\Carbon;
use Distilleries\Expendable\Contracts\ExportContract;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadings;
class BaseExport implements FromQuery, WithHeadings, ExportContract
{
use Exportable;
/**
* @var \Distilleries\Expendable\Models\BaseModel
*/
private $model;
* @var Carbon
private $start;
private $end;
public function __construct($model, $data)
$this->setModel($model);
$this->setRange($data);
}
public function export($fileName)
return $this->download($fileName);
* @return \Illuminate\Database\Query\Builder
public function query()
return $this->model->betweenCreate($this->start, $this->end);
betweenCreate()
Distilleries\Expendable\Models\BaseModel
scopeBetweenCreate()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
* @param mixed $model
* @return $this
public function setModel($model)
$this->model = $model;
return $this;
* @param array $data
public function setRange($data)
foreach ($data['range'] as $key => $date)
Carbon::parse($date);
$this->$key = Carbon::parse($date);
* @inheritdoc
public function headings(): array
return \Illuminate\Support\Facades\Schema::getColumnListing($this->model->getTable());
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.