-
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.
- Loading branch information
Showing
634 changed files
with
43,522 additions
and
7,283 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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\ContentPage; | ||
|
||
use App\Models\ContentPage; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class CreateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(array $data): void | ||
{ | ||
$contentPage = new ContentPage($data); | ||
$contentPage->save(); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\ContentPage; | ||
|
||
use App\Models\ContentPage; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class DeleteAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(ContentPage $contentPage): void | ||
{ | ||
$contentPage->delete(); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\ContentPage; | ||
|
||
use App\Models\ContentPage; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class UpdateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(array $data, ContentPage $contentPage): void | ||
{ | ||
$contentPage->update($data); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\CustomField; | ||
|
||
use App\Models\CustomField; | ||
use App\Models\Institute; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class CreateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(array $data, Institute $institute): void | ||
{ | ||
if (!isset($data['sortkey'])) { | ||
$data['sortkey'] = $this->getHighestSortkey($institute) + 1; | ||
} | ||
|
||
$customField = new CustomField($data); | ||
|
||
$customField->institute()->associate($institute); | ||
$customField->save(); | ||
} | ||
|
||
private function getHighestSortkey(Institute $institute): int | ||
{ | ||
return $institute->customFields()->max('sortkey') ?? 0; | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\CustomField; | ||
|
||
use App\Models\CustomField; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class DeleteAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(CustomField $customField): void | ||
{ | ||
$customField->delete(); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\CustomField; | ||
|
||
use App\Models\CustomField; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class UpdateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(CustomField $customField, array $data): void | ||
{ | ||
$customField->update($data); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/Actions/HomepageInformation/EditHomepageInformationAction.php
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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\HomepageInformation; | ||
|
||
use App\Helpers\WYSIWYG; | ||
use App\Models\Institute; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class EditHomepageInformationAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(array $data, Institute $institute): void | ||
{ | ||
$institute->update([ | ||
'homepage_title_en' => $data['homepage_title_en'], | ||
'homepage_body_en' => WYSIWYG::isEmpty($data['homepage_body_en']) ? null : $data['homepage_body_en'], | ||
'homepage_title_nl' => $data['homepage_title_nl'], | ||
'homepage_body_nl' => WYSIWYG::isEmpty($data['homepage_body_nl']) ? null : $data['homepage_body_nl'], | ||
]); | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Institute; | ||
|
||
use App\Models\Institute; | ||
use App\Models\User; | ||
|
||
class ImpersonateAction | ||
{ | ||
public function execute(User $user, Institute $institute): void | ||
{ | ||
$user->impersonatedInstitute()->associate($institute); | ||
$user->save(); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Institute; | ||
|
||
use App\Models\User; | ||
|
||
class StopImpersonatingAction | ||
{ | ||
public function execute(User $user): void | ||
{ | ||
$user->impersonatedInstitute()->disassociate(); | ||
$user->save(); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Institute\Tag; | ||
|
||
use App\Models\Institute; | ||
use App\Models\Tag; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class CreateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(array $data, Institute $institute): void | ||
{ | ||
$tag = Tag::create(['name' => $data['name'], 'type' => $data['type']]); | ||
$tag->institute()->associate($institute); | ||
|
||
if (isset($data['description']['en']) || isset($data['description']['nl'])) { | ||
$tag->setTranslations('description', $data['description']); | ||
} | ||
|
||
$tag->save(); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Institute\Tag; | ||
|
||
use App\Models\Tag; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class DeleteAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(Tag $tag): void | ||
{ | ||
$tag->delete(); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Institute\Tag; | ||
|
||
use App\Models\Tag; | ||
use Spatie\QueueableAction\QueueableAction; | ||
|
||
class UpdateAction | ||
{ | ||
use QueueableAction; | ||
|
||
public function execute(Tag $tag, array $data): void | ||
{ | ||
$tag->setTranslations('name', $data['name']); | ||
|
||
if (isset($data['description'])) { | ||
$tag->setTranslations('description', $data['description']); | ||
} | ||
|
||
$tag->type = $data['type']; | ||
|
||
$tag->save(); | ||
} | ||
} |
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.