app(Dispatcher::class)->dispatch($job);
$places
->whereHas(....)
->orWhereNotExists(function ($query) {
$query->select(DB::raw(1))
->from('leases')
->whereRaw('leases.place_id = places.id');
})
$contact->phoneNums()->delete();
foreach(...){
//добавляем из массива
}
Дважды обследовал документацию по сессии
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, Excel5);
$outputFileName = "file.xls";
//$objWriter->save($outputFileName);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $outputFileName . '"');
header('Cache-Control: max-age=0');
$objWriter->save('php://output');