Файловый менеджер - Редактировать - /home/clickysoft/public_html/app/Http/Controllers/Api/V1/CurrenciesApiController.php
Назад
<?php namespace App\Http\Controllers\Api\V1; use App\Http\Controllers\Controller; use App\Http\Requests\StoreCurrencyRequest; use App\Http\Requests\UpdateCurrencyRequest; use App\Http\Resources\Admin\CurrencyDropDownResource; use App\Http\Resources\Admin\CurrencyResource; use App\Models\Currency; use Gate; use Symfony\Component\HttpFoundation\Response; class CurrenciesApiController extends Controller { public function index() { abort_if(Gate::denies('currency_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); return CurrencyResource::collection(Currency::paginate(50)); } public function dropDown() { abort_if(Gate::denies('currency_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); return CurrencyDropDownResource::collection(Currency::get()); } public function store(StoreCurrencyRequest $request) { $currency = Currency::create($request->all()); return (new CurrencyResource($currency)) ->response() ->setStatusCode(Response::HTTP_CREATED); } public function show(Currency $currency) { abort_if(Gate::denies('currency_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); return new CurrencyResource($currency); } public function update(UpdateCurrencyRequest $request, Currency $currency) { $currency->update($request->all()); return (new CurrencyResource($currency)) ->response() ->setStatusCode(Response::HTTP_ACCEPTED); } public function destroy(Currency $currency) { abort_if(Gate::denies('currency_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $currency->delete(); return response(null, Response::HTTP_NO_CONTENT); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка