adrema/app/Activity/Actions/EditAction.php

23 lines
487 B
PHP
Raw Permalink Normal View History

2023-02-25 17:19:17 +01:00
<?php
namespace App\Activity\Actions;
use App\Activity;
use App\Activity\Resources\ActivityResource;
use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\Concerns\AsAction;
class EditAction
{
use AsAction;
public function handle(Activity $activity): Response
{
return Inertia::render('activity/VForm', [
'meta' => ActivityResource::meta(),
'data' => new ActivityResource($activity->load('subactivities')),
]);
}
}