automngr/app/Http/Controllers/BrandController.php

92 lines
1.8 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Brand;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
class BrandController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
*/
public function store(Request $request)
{
$brand = Brand::create(
$request->validate([
'name' => ['required', 'string', 'max:255'],
])
)->only('id', 'name');
return $brand;
}
/**
* Display the specified resource.
*
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\Response
*/
public function show(Brand $brand)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\Response
*/
public function edit(Brand $brand)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Brand $brand)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Brand $brand
* @return \Illuminate\Http\Response
*/
public function destroy(Brand $brand)
{
//
}
}