adrema/app/Maildispatcher/Actions/IndexAction.php

26 lines
683 B
PHP
Raw Permalink Normal View History

2023-06-12 13:12:46 +02:00
<?php
namespace App\Maildispatcher\Actions;
2023-06-13 22:03:32 +02:00
use App\Maildispatcher\Models\Maildispatcher;
use App\Maildispatcher\Resources\MaildispatcherResource;
use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\ActionRequest;
2023-06-12 13:12:46 +02:00
use Lorisleiva\Actions\Concerns\AsAction;
class IndexAction
{
use AsAction;
2023-06-13 22:03:32 +02:00
public function asController(ActionRequest $request): Response
2023-06-12 13:12:46 +02:00
{
2023-06-13 22:03:32 +02:00
session()->put('menu', 'maildispatcher');
session()->put('title', 'Mail-Verteiler');
return Inertia::render('maildispatcher/MaildispatcherIndex', [
'data' => MaildispatcherResource::collection(Maildispatcher::with('gateway')->paginate(10)),
]);
2023-06-12 13:12:46 +02:00
}
}