adrema/app/Actions/PullMemberAction.php

25 lines
499 B
PHP
Raw Normal View History

2023-02-05 23:35:08 +01:00
<?php
namespace App\Actions;
use App\Member\Member;
2023-02-12 23:18:58 +01:00
use App\Nami\Api\MemberAction;
2023-02-05 23:35:08 +01:00
use App\Setting\NamiSettings;
use Lorisleiva\Actions\Concerns\AsAction;
use Zoomyboy\LaravelNami\Api;
class PullMemberAction
{
use AsAction;
public function handle(int $groupId, int $memberId): Member
2023-02-05 23:35:08 +01:00
{
2023-02-12 23:18:58 +01:00
return InsertMemberAction::run(MemberAction::run($this->api(), $groupId, $memberId));
2023-02-05 23:35:08 +01:00
}
private function api(): Api
{
return app(NamiSettings::class)->login();
}
}