45 lines
836 B
PHP
45 lines
836 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Goods;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Http\Resources\GoodsBrandResource;
|
||
|
|
use App\Models\GoodsBrand;
|
||
|
|
|
||
|
|
class GoodsBrandsController extends Controller
|
||
|
|
{
|
||
|
|
public function index()
|
||
|
|
{
|
||
|
|
$goodsBrands = GoodsBrand::query()->paginate();
|
||
|
|
|
||
|
|
return GoodsBrandResource::collection($goodsBrands);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function store(Request $request)
|
||
|
|
{
|
||
|
|
$request->validate([
|
||
|
|
'name' => 'required|string|unique:users|max:255',
|
||
|
|
]);
|
||
|
|
|
||
|
|
GoodsBrand::created();
|
||
|
|
}
|
||
|
|
|
||
|
|
public function show($id)
|
||
|
|
{
|
||
|
|
$columns = ['*'];
|
||
|
|
$goodsBrand = GoodsBrand::query()->find($id, $columns);
|
||
|
|
|
||
|
|
return GoodsBrandResource::collection($goodsBrand);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function update()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
public function destory()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|