This commit is contained in:
philipp lang 2024-02-23 00:35:29 +01:00
parent a12cb53274
commit ada03a11ea
2 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,7 @@ use App\Form\Models\Form;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Lorisleiva\Actions\ActionRequest; use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction; use Lorisleiva\Actions\Concerns\AsAction;
use Symfony\Component\HttpFoundation\JsonResponse;
class FormUpdateMetaAction class FormUpdateMetaAction
{ {
@ -36,7 +37,7 @@ class FormUpdateMetaAction
$form->update(['meta' => $input]); $form->update(['meta' => $input]);
} }
public function asController(Form $form, ActionRequest $request) public function asController(Form $form, ActionRequest $request): JsonResponse
{ {
$this->handle($form, $request->validated()); $this->handle($form, $request->validated());

View File

@ -3,17 +3,20 @@
namespace App\Remote\Actions; namespace App\Remote\Actions;
use App\Initialize\Actions\NamiSearchAction; use App\Initialize\Actions\NamiSearchAction;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Crypt;
use Lorisleiva\Actions\ActionRequest; use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction; use Lorisleiva\Actions\Concerns\AsAction;
use Zoomyboy\LaravelNami\Api;
use Zoomyboy\LaravelNami\Nami; use Zoomyboy\LaravelNami\Nami;
class SearchAction class SearchAction
{ {
use AsAction; use AsAction;
public function handle(ActionRequest $request) /**
* @return LengthAwarePaginator<array<string, mixed>>
*/
public function handle(ActionRequest $request): LengthAwarePaginator
{ {
$token = str($request->header('Authorization'))->replace('Bearer ', '')->toString(); $token = str($request->header('Authorization'))->replace('Bearer ', '')->toString();
$credentials = json_decode(Crypt::decryptString($token)); $credentials = json_decode(Crypt::decryptString($token));