-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCreateAntrag.php
More file actions
71 lines (56 loc) · 1.82 KB
/
CreateAntrag.php
File metadata and controls
71 lines (56 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
namespace App\Livewire;
use App\Livewire\Forms\ActorForm;
use App\Livewire\Forms\FundingRequestForm;
use App\Livewire\Forms\ProjectBudgetForm;
use App\Models\PtfProject\Actor;
use Livewire\Attributes\Url;
use Livewire\Component;
class CreateAntrag extends Component
{
#[Url]
public int $page = 1;
public ActorForm $userForm;
public ActorForm $organisationForm;
public $projectForm; // might have been deleted at the rework of the project view
public ProjectBudgetForm $projectBudgetForm;
public FundingRequestForm $fundingRequestForm;
public function store()
{
// TODO: call all form store methods
}
// pro Antragsschritt die Page variable hochzählen und damit Weiterleitung zum nächsten Schritt:
// Step 1: User / Actor
// Step 2: Projekt + Aufgabe der Studischaft
// Step 3: Finanzplan
// Step 4: Antrag
// Step 5: Anhänge
public function render()
{
// for better code analysis, and better error handling a bit more verbose than needed
switch ($this->page) {
case 1:
$users = Actor::user()->get();
$orgs = Actor::organisation()->get();
return view('livewire.create-antrag.1', ['users' => $users, 'orgs' => $orgs]);
case 2:
return view('livewire.create-antrag.2');
case 3:
return view('livewire.create-antrag.3');
case 4:
return view('livewire.create-antrag.4');
case 5:
return view('livewire.create-antrag.5');
default:
abort(404);
}
}
public function nextPage(): void
{
$this->page = min($this->page + 1, 5);
}
public function previousPage(): void
{
$this->page = max($this->page - 1, 1);
}
}