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;
|
|
|
|
|
2023-02-07 23:23:15 +01:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|