adrema/app/User/Actions/IndexAction.php

19 lines
394 B
PHP
Raw Normal View History

2024-07-31 22:47:04 +02:00
<?php
namespace App\User\Actions;
use App\Http\Resources\UserResource;
use App\User;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Lorisleiva\Actions\Concerns\AsAction;
class IndexAction
{
use AsAction;
public function handle(): AnonymousResourceCollection
{
return UserResource::collection(User::orderByRaw('lastname, firstname')->get());
}
}