Skip to content

Commit

Permalink
fix nova admin
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVHG committed Aug 6, 2024
1 parent 88fbc4d commit ad8eb9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Domain/Integrations/Models/IntegrationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function keyVisibilityUpgrade(): HasOne
/**
* @return HasMany<UdbOrganizerModel>
*/
public function udbOrganizers(): HasMany
public function organizers(): HasMany
{
return $this->hasMany(UdbOrganizerModel::class, 'integration_id');
}
Expand Down Expand Up @@ -361,7 +361,7 @@ public function toDomain(): Integration
->map(fn (KeycloakClientModel $keycloakClientModel) => $keycloakClientModel->toDomain())
->toArray()
)->withUdbOrganizers(
...$this->udbOrganizers()
...$this->organizers()
->get()
->map(fn (UdbOrganizerModel $organizerModel) => $organizerModel->toDomain())
->toArray()
Expand Down
2 changes: 1 addition & 1 deletion app/Nova/Resources/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function (Text $field, NovaRequest $request, FormData $formData) {
}

return array_merge($fields, [
HasMany::make('UDB3 Organizers', 'organizers', UdbOrganizer::class)
HasMany::make('UDB3 Organizers', 'organizers', UdbOrganizerModel::class)
->canSee(function () {
/** @var ?IntegrationModel $model */
$model = $this->model();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use Laravel\Nova\Http\Requests\NovaRequest;

/**
* @mixin UdbOrganizer
* @mixin UdbOrganizerModel
*/
final class UdbOrganizer extends Resource
final class UdbOrganizerModel extends Resource
{
public static string $model = UdbOrganizer::class;
public static string $model = UdbOrganizerModel::class;

public static $title = 'organizer_id';

Expand Down

0 comments on commit ad8eb9e

Please sign in to comment.