CategoryAdminController
extends ApiController
in package
Uses
OrderCategoryTrait
Table of Contents
Properties
- $repository : CategoryRepositoryInterface
- $orderSuccessMessage : mixed
- $metadata : array<string|int, mixed>
- $metamessage : string|null
Methods
- __construct() : mixed
- addMetadata() : mixed
- alert() : mixed
- create() : JsonResponse
- View creation form.
- default() : JsonResponse
- delete() : JsonResponse
- View creation form.
- destroy() : JsonResponse
- Remove the specified resource from storage.
- error() : JsonResponse
- Error Response.
- getUser() : User
- index() : JsonResource
- info() : JsonResponse
- Info Response.
- keepCacheSuccess() : JsonResponse
- Tell client keep its cache and does not response data.
- message() : mixed
- navigate() : mixed
- order() : JsonResponse
- show() : CategoryItem
- Display the specified resource.
- store() : JsonResponse
- Store a newly created resource in storage.
- success() : JsonResponse
- Success Response.
- toggleActive() : JsonResponse
- Update active status.
- update() : JsonResponse
- Update the specified resource in storage.
- warning() : JsonResponse
- Warning Response.
- processReturn() : JsonResponse
Properties
$repository
public
CategoryRepositoryInterface
$repository
$orderSuccessMessage
protected
mixed
$orderSuccessMessage
= 'core::phrase.categories_successfully_ordered'
$metadata
private
array<string|int, mixed>
$metadata
= []
$metamessage
private
string|null
$metamessage
= null
Methods
__construct()
public
__construct(CategoryRepositoryInterface $repository) : mixed
Parameters
- $repository : CategoryRepositoryInterface
addMetadata()
public
addMetadata([array<string|int, mixed>|null $meta = [] ]) : mixed
Parameters
- $meta : array<string|int, mixed>|null = []
alert()
public
alert(mixed $alert) : mixed
Parameters
- $alert : mixed
create()
View creation form.
public
create() : JsonResponse
Return values
JsonResponsedefault()
public
default(int $id) : JsonResponse
Parameters
- $id : int
Return values
JsonResponsedelete()
View creation form.
public
delete(int $id) : JsonResponse
Parameters
- $id : int
Return values
JsonResponsedestroy()
Remove the specified resource from storage.
public
destroy(DeleteRequest $request, int $id) : JsonResponse
Parameters
- $request : DeleteRequest
- $id : int
Tags
Return values
JsonResponseerror()
Error Response.
public
error([string $error = '' ][, int $code = 400 ][, array<string|int, mixed> $headers = [] ][, int $options = 0 ]) : JsonResponse
Parameters
- $error : string = ''
- $code : int = 400
- $headers : array<string|int, mixed> = []
- $options : int = 0
Return values
JsonResponsegetUser()
public
getUser() : User
Return values
Userindex()
public
index(IndexRequest $request) : JsonResource
Parameters
- $request : IndexRequest
Tags
Return values
JsonResourceinfo()
Info Response.
public
info([object|array<string|int, mixed>|null $data = [] ][, array<string, mixed> $extra = [] ][, array<string|int, mixed>|string|null $message = null ][, int $code = 200 ][, array<string, mixed> $headers = [] ][, int $options = 0 ]) : JsonResponse
Parameters
- $data : object|array<string|int, mixed>|null = []
- $extra : array<string, mixed> = []
- $message : array<string|int, mixed>|string|null = null
- $code : int = 200
- $headers : array<string, mixed> = []
- $options : int = 0
Return values
JsonResponsekeepCacheSuccess()
Tell client keep its cache and does not response data.
public
keepCacheSuccess([array<string|int, mixed> $data = [] ]) : JsonResponse
Parameters
- $data : array<string|int, mixed> = []
Return values
JsonResponsemessage()
public
message(mixed $message) : mixed
Parameters
- $message : mixed
navigate()
public
navigate(string $url[, bool $replace = false ]) : mixed
Parameters
- $url : string
- $replace : bool = false
order()
public
order(Request $request) : JsonResponse
Parameters
- $request : Request
Return values
JsonResponseshow()
Display the specified resource.
public
show(int $id) : CategoryItem
Parameters
- $id : int
Tags
Return values
CategoryItemstore()
Store a newly created resource in storage.
public
store(StoreRequest $request) : JsonResponse
Parameters
- $request : StoreRequest
Tags
Return values
JsonResponsesuccess()
Success Response.
public
success([object|array<string|int, mixed>|null $data = [] ][, array<string, mixed> $meta = [] ][, array<string|int, mixed>|string|null $message = null ][, int $code = 200 ][, array<string, mixed> $headers = [] ][, int $options = 0 ]) : JsonResponse
Parameters
- $data : object|array<string|int, mixed>|null = []
- $meta : array<string, mixed> = []
- $message : array<string|int, mixed>|string|null = null
- $code : int = 200
- $headers : array<string, mixed> = []
- $options : int = 0
Return values
JsonResponsetoggleActive()
Update active status.
public
toggleActive(int $id) : JsonResponse
Parameters
- $id : int
Return values
JsonResponseupdate()
Update the specified resource in storage.
public
update(UpdateRequest $request, int $id) : JsonResponse
Parameters
- $request : UpdateRequest
- $id : int
Tags
Return values
JsonResponsewarning()
Warning Response.
public
warning([object|array<string|int, mixed>|null $data = [] ][, array<string, mixed> $extra = [] ][, array<string|int, mixed>|string|null $message = null ][, int $code = 200 ][, array<string, mixed> $headers = [] ][, int $options = 0 ]) : JsonResponse
Parameters
- $data : object|array<string|int, mixed>|null = []
- $extra : array<string, mixed> = []
- $message : array<string|int, mixed>|string|null = null
- $code : int = 200
- $headers : array<string, mixed> = []
- $options : int = 0
Return values
JsonResponseprocessReturn()
private
processReturn(string $status, mixed|object $data[, array<string|int, mixed>|string|null $message = null ][, string|null $error = null ][, int $code = 200 ][, array<string|int, mixed> $headers = [] ][, int $options = JSON_PRETTY_PRINT ][, array<string|int, mixed> $meta = [] ]) : JsonResponse
Parameters
- $status : string
- $data : mixed|object
- $message : array<string|int, mixed>|string|null = null
- $error : string|null = null
- $code : int = 200
- $headers : array<string|int, mixed> = []
- $options : int = JSON_PRETTY_PRINT
- $meta : array<string|int, mixed> = []