-
app/Http/Resources/Admin/CategoryResource.php
Open in GitHubuse Illuminate\Http\Resources\Json\JsonResource; class CategoryResource extends JsonResource { public function toArray($request) { return parent::toArray($request); } }
-
app/Http/Resources/Admin/CategoryResource.php
Open in GitHubuse Illuminate\Http\Resources\Json\JsonResource; class CategoryResource extends JsonResource { public function toArray($request) { return parent::toArray($request); } }
-
app/Http/Controllers/Api/V1/Admin/CategoriesApiController.php
Open in GitHubuse App\Category; use App\Http\Controllers\Controller; use App\Http\Requests\StoreCategoryRequest; use App\Http\Resources\Admin\CategoryResource; use Symfony\Component\HttpFoundation\Response; class CategoriesApiController extends Controller { // public function store(StoreCategoryRequest $request) { $category = Category::create($request->all()); return (new CategoryResource($category)) ->response() ->setStatusCode(Response::HTTP_CREATED); } // }