-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xslx export with lab data for easier reviewing data in FAST
- Loading branch information
1 parent
705a35d
commit e239aac
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace App\Exports; | ||
|
||
use App\Models\Laboratory; | ||
use App\Models\MappingLog; | ||
use Maatwebsite\Excel\Concerns\FromCollection; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
use Maatwebsite\Excel\Concerns\WithMapping; | ||
|
||
class LabExport implements FromCollection, WithHeadings, WithMapping | ||
{ | ||
|
||
public function __construct() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @return \Illuminate\Support\Collection | ||
*/ | ||
public function collection() | ||
{ | ||
return Laboratory::get(); | ||
} | ||
|
||
public function headings(): array | ||
{ | ||
return [ | ||
'fast_id', | ||
'name', | ||
'latitude', | ||
'longitude' | ||
]; | ||
} | ||
|
||
public function map($laboratory): array | ||
{ | ||
return [ | ||
$laboratory->fast_id, | ||
$laboratory->name, | ||
$laboratory->latitude, | ||
$laboratory->longitude | ||
]; | ||
} | ||
|
||
} |
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
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
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