-
-
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.
event application excel export added.
- Loading branch information
1 parent
2056e03
commit f6b34a3
Showing
4 changed files
with
597 additions
and
4 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,71 @@ | ||
<?php | ||
|
||
namespace App\Exports; | ||
|
||
use App\Models\EventApplication; | ||
use Maatwebsite\Excel\Concerns\FromCollection; | ||
use Maatwebsite\Excel\Concerns\WithHeadings; | ||
use Maatwebsite\Excel\Concerns\WithMapping; | ||
|
||
class EventApplicationExport implements FromCollection, WithMapping, WithHeadings | ||
{ | ||
/** | ||
* @return \Illuminate\Support\Collection | ||
*/ | ||
public function collection(): \Illuminate\Support\Collection | ||
{ | ||
return EventApplication::with(['city', 'user'])->get(); | ||
} | ||
|
||
public function headings(): array | ||
{ | ||
return [ | ||
'Başvuru ID', | ||
'Adı Soyadı', | ||
'E-Posta', | ||
'Telefon', | ||
'Şehir', | ||
'İş', | ||
'Çadır', | ||
'Uyku Tulumu', | ||
'Mat', | ||
'Sandalye', | ||
'Teleskop', | ||
'Teleskop Markası', | ||
'Dürbün', | ||
'Kamera', | ||
'Tripod', | ||
'Telsiz', | ||
'Bilgisayar', | ||
'Geliş Tarihi', | ||
'Ayrılış Tarihi', | ||
'Check-In Tarihi', | ||
]; | ||
} | ||
|
||
public function map($eventApplication): array | ||
{ | ||
return [ | ||
$eventApplication->id, | ||
$eventApplication->user->name, | ||
$eventApplication->user->email, | ||
$eventApplication->user->phone, | ||
$eventApplication->city->name, | ||
$eventApplication->job, | ||
$eventApplication->tent, | ||
$eventApplication->sleeping_bag, | ||
$eventApplication->mat, | ||
$eventApplication->chair, | ||
$eventApplication->telescope, | ||
$eventApplication->telescope_brand, | ||
$eventApplication->binocular, | ||
$eventApplication->camera, | ||
$eventApplication->tripod, | ||
$eventApplication->walkie_talkie, | ||
$eventApplication->computer, | ||
$eventApplication->arrival_date, | ||
$eventApplication->departure_date, | ||
$eventApplication->check_in, | ||
]; | ||
} | ||
} |
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.