Файловый менеджер - Редактировать - /home/clickysoft/public_html/app/Http/Controllers/Api/V1/CountriesApiController.php
Назад
<?php namespace App\Http\Controllers\Api\V1; use App\Http\Controllers\Controller; use App\Http\Requests\StoreCountryRequest; use App\Http\Requests\UpdateCountryRequest; use App\Http\Resources\Admin\CountryResource; use App\Models\Country; use Gate; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; class CountriesApiController extends Controller { public function index() { abort_if(Gate::denies('country_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); return new CountryResource(Country::all()); } public function store(StoreCountryRequest $request) { $country = Country::create($request->all()); return (new CountryResource($country)) ->response() ->setStatusCode(Response::HTTP_CREATED); } public function show(Country $country) { abort_if(Gate::denies('country_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); return new CountryResource($country); } public function update(UpdateCountryRequest $request, Country $country) { $country->update($request->all()); return (new CountryResource($country)) ->response() ->setStatusCode(Response::HTTP_ACCEPTED); } public function destroy(Country $country) { abort_if(Gate::denies('country_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $country->delete(); return response(null, Response::HTTP_NO_CONTENT); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка