Revision 175 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpnamespace App\Http\Controllers\online_shop;use App\Http\Controllers\Controller;use App\Http\Requests\ManufacturerRequest;use App\Models\Manufacturer;use Illuminate\Contracts\Foundation\Application;use Illuminate\Contracts\View\Factory;use Illuminate\Contracts\View\View;class ManufacturerController extends Controller{//public function index(): Factory|View|Application{$manufacturers = Manufacturer::all();return view( "online_shop.manufacturerList", [ "manufacturers" => $manufacturers ] );}public function create(): Factory|View|Application{return View( 'online_shop.manufacturer' );}public function edit( Manufacturer $manufacturer ): Factory|View|Application{return View( 'online_shop.manufacturer', [ "zeile" => $manufacturer ] );}public function show( Manufacturer $manufacturer ){echo $manufacturer->name;}public function store( ManufacturerRequest $request ): void{$data = $request->validated();Manufacturer::create( $data );}public function update( ManufacturerRequest $request, Manufacturer $manufacturer ): void{$data = $request->validated();$manufacturer->update( $data );}public function destroy( Manufacturer $manufacturer ): void{$manufacturer->delete();}}