Files
dots-bot-api/app/Http/Controllers/API/v2/CategoryController.php
T
KKlochko b5a264d92f Added Category model, resource and its API.
Updated Company model to have Categories.
2023-06-14 16:58:35 +03:00

72 lines
1.4 KiB
PHP

<?php
namespace App\Http\Controllers\API\v2;
use App\Http\Requests\StoreCategoryRequest;
use App\Http\Requests\UpdateCategoryRequest;
use App\Models\Category;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\API\v2\CategoryResource;
use App\Http\Resources\API\v2\CategoryCollection;
class CategoryController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return new CategoryCollection(Category::all());
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(StoreCategoryRequest $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Category $category)
{
return new CategoryResource($category);
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Category $category)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateCategoryRequest $request, Category $category)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Category $category)
{
//
}
}