adrema/app/Activity/Api/SubactivityShowAction.php

27 lines
524 B
PHP
Raw Normal View History

2023-03-07 01:35:39 +01:00
<?php
namespace App\Activity\Api;
use App\Resources\SubactivityResource;
use App\Subactivity;
use Illuminate\Http\JsonResponse;
use Lorisleiva\Actions\Concerns\AsAction;
class SubactivityShowAction
{
use AsAction;
public function handle()
{
// ...
}
public function asController(Subactivity $subactivity): JsonResponse
{
return response()->json([
'data' => new SubactivityResource($subactivity),
'meta' => SubactivityResource::meta(),
]);
}
}