adrema/app/Member/Controllers/MemberResyncController.php

22 lines
634 B
PHP
Raw Normal View History

2022-04-29 00:57:24 +02:00
<?php
namespace App\Member\Controllers;
2023-02-06 00:24:57 +01:00
use App\Actions\PullMemberAction;
2022-04-29 00:57:24 +02:00
use App\Http\Controllers\Controller;
use App\Member\Member;
use App\Setting\NamiSettings;
use Illuminate\Http\RedirectResponse;
class MemberResyncController extends Controller
{
public function __invoke(Member $member, NamiSettings $settings): RedirectResponse
{
if ($member->hasNami) {
2023-02-06 00:24:57 +01:00
app(PullMemberAction::class)->api($settings->login())->member($member->group->nami_id, $member->nami_id)->execute();
2022-04-29 00:57:24 +02:00
}
return redirect()->route('member.edit', ['member' => $member])->success('Mitglied aktualisiert');
}
}