Skip to content

Commit 1f73709

Browse files
committed
Merge branch 'master' of matrixinternet.github.com:codeeu/codeweek
2 parents 4b8e914 + 2235e3e commit 1f73709

37 files changed

Lines changed: 1318 additions & 80 deletions

app/Console/Commands/CertificatesOfParticipationGeneration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CertificatesOfParticipationGeneration extends Command
2828
public function handle(): int
2929
{
3030

31-
$participations = Participation::whereNull('participation_url')->where('status', '<>', 'ERROR')->orderByDesc('created_at')->get();
31+
$participations = Participation::whereNull('participation_url')->where('status', '=', 'PENDING')->orderByDesc('created_at')->get();
3232

3333
$this->info(count($participations).' certificates of participation to generate');
3434

app/Http/Controllers/ParticipationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function generate(Request $request): RedirectResponse
5252
$participation->save();
5353

5454
//Dispatch Job
55-
GenerateCertificatesOfParticipation::dispatch($participation);
55+
GenerateCertificatesOfParticipation::dispatchSync($participation);
5656

5757
return redirect()->route('certificates');
5858

app/Jobs/GenerateCertificatesOfParticipation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public function handle(): void
3333
{
3434
$names = array_map('trim', explode(',', $this->participation->names));
3535

36+
$this->participation['status'] = 'PROCESSING';
37+
38+
$this->participation->save();
39+
3640
$zipUrl = CertificatesHelper::doGenerateCertificatesOfParticipation($names, $this->participation->event_name, $this->participation->event_date);
3741

3842
$this->participation['participation_url'] = $zipUrl;

app/Providers/AppServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Illuminate\Support\Facades\View;
1313
use Illuminate\Support\ServiceProvider;
1414
use Illuminate\Validation\Rules\Password;
15-
15+
use Illuminate\Support\Facades\Blade;
1616
class AppServiceProvider extends ServiceProvider
1717
{
1818
/**
@@ -82,6 +82,9 @@ function ($view) {
8282
);
8383
});
8484

85+
// Register the Minecraft Blade component
86+
Blade::component('homepage.minecraft', 'minecraft');
87+
8588
$this->bootAuth();
8689
$this->bootEvent();
8790
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\View\Components;
4+
5+
use Closure;
6+
use Illuminate\Contracts\View\View;
7+
use Illuminate\View\Component;
8+
9+
class MinecraftSection extends Component
10+
{
11+
/**
12+
* Create a new component instance.
13+
*/
14+
public function __construct()
15+
{
16+
//
17+
}
18+
19+
/**
20+
* Get the view / contents that represent the component.
21+
*/
22+
public function render(): View|Closure|string
23+
{
24+
return view('components.minecraft-section');
25+
}
26+
}

0 commit comments

Comments
 (0)