Skip to content

Commit

Permalink
Merge pull request #2190 from codeeu/2189-dutch-events
Browse files Browse the repository at this point in the history
Dutch import
  • Loading branch information
alainvd authored Nov 14, 2023
2 parents 856015a + 84cce6c commit 4955c41
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
50 changes: 50 additions & 0 deletions app/Console/Commands/excel/Dutch2023.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Console\Commands\excel;

use App\Imports\DutchDanceEventsImport;
use App\Imports\DutchMoorlagEventsImport;
use App\Imports\DutchSimoneEventsImport;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Maatwebsite\Excel\Facades\Excel;

class Dutch2023 extends Command {
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'excel:dutch-2023';

/**
* The console command description.
*
* @var string
*/
protected $description = '2023 Dutch Activities';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct() {
parent::__construct();
}

/**
* Execute the console command.
*
* @return int
*/
public function handle() {
Log::info('Loading 2023 Dutch File');

Excel::import(
new DutchSimoneEventsImport(),
'dutch-2023-14-11.xlsx',
'excel'
);
}
}
4 changes: 2 additions & 2 deletions app/Imports/DutchSimoneEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public function model(array $row) {
'location' => $row['address'],
'event_url' => $row['organiser_website'],
'user_email' => '',
'creator_id' => 219395,
'creator_id' => 190341,
'contact_person' => $row['contact_email'],
'country_iso' => $row['country'],
'picture' => $row['image_path'],
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw22-CodeWeekNL',
'codeweek_for_all_participation_code' => 'cw23-CodeWeekNL',
'start_date' => $this->parseDate($row['start_date']),
'end_date' => $this->parseDate($row['end_date']),
'geoposition' => $row['latitude'] . ',' . $row['longitude'],
Expand Down
Binary file added resources/excel/dutch-2023-14-11.xlsx
Binary file not shown.

0 comments on commit 4955c41

Please sign in to comment.