v7.0.0-beta.4 release
This commit is contained in:
1 parent
05db17887d
commit
1db039ff34
1545 files changed
+136783
-11634
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin\Identity;
|
||||
|
||||
use App\Http\Resources\BaseApiCollection;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* IDV 메시지 정의 컬렉션.
|
||||
*/
|
||||
class IdentityMessageDefinitionCollection extends BaseApiCollection
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected function abilityMap(): array
|
||||
{
|
||||
return [
|
||||
'can_update' => 'core.admin.identity.messages.update',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 컬렉션을 배열로 변환합니다.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$sortOrder = $request->input('sort_order', 'asc');
|
||||
$abilities = $this->resolveCollectionAbilities($request);
|
||||
|
||||
return [
|
||||
'data' => $this->mapWithRowNumber(function ($definition) use ($request) {
|
||||
return (new IdentityMessageDefinitionResource($definition))->toArray($request);
|
||||
}, $sortOrder),
|
||||
'pagination' => [
|
||||
'current_page' => $this->currentPage(),
|
||||
'last_page' => $this->lastPage(),
|
||||
'per_page' => $this->perPage(),
|
||||
'total' => $this->total(),
|
||||
'from' => $this->firstItem(),
|
||||
'to' => $this->lastItem(),
|
||||
'has_more_pages' => $this->hasMorePages(),
|
||||
],
|
||||
...($abilities ? ['abilities' => $abilities] : []),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user