-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update photos export JSON format * Add photos export CSV format * Add headings for CSV export
- Loading branch information
Showing
10 changed files
with
645 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace App\Exports; | ||
|
||
use App\DTO\PhotoExport; | ||
use Generator; | ||
use Maatwebsite\Excel\Concerns\Exportable; | ||
use Maatwebsite\Excel\Concerns\FromGenerator; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
|
||
readonly class PhotosCsvExport implements FromGenerator, WithHeadings | ||
{ | ||
use Exportable; | ||
|
||
/** | ||
* @param Generator<PhotoExport> $photos | ||
*/ | ||
public function __construct(private Generator $photos) | ||
{ | ||
} | ||
|
||
public function generator(): Generator | ||
{ | ||
return $this->photos; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function headings(): array | ||
{ | ||
return [ | ||
'ID', | ||
'Original File Name', | ||
'Latitude', | ||
'Longitude', | ||
'Taken At Local', | ||
'Created At', | ||
'Items', | ||
]; | ||
} | ||
} |
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
Oops, something went wrong.