Initial commit - Katica Bufe project

This commit is contained in:
Krisztu
2026-02-19 12:34:28 +01:00
commit 2388451197
66 changed files with 11185 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}

View File

@@ -0,0 +1,68 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Forgalom;
class forgalomController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$adatok = Forgalom::all()->map(function($elem) {
return [
"Név:"=> $elem->termek,
"Ár:"=> $elem->nettoar
];
});
return response()->json($adatok, 200, ["Content-Type" => "application/json"]);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
$rekord = Forgalom::find($request["id"]);
if(!$rekord){
return response("Nem létező rendelés",400);
}
$rekord->update(["kiadva"=>true]);
return response("Sikeres frissítés",200);
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$torol = Forgalom::find($id);
if(!$torol){
return response("Nem létező rendelés",404);
}
$torol->delete();
return response("Sikeres törlés",204);
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Kategoria;
class kategoriaController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$adatok = Kategoria::all();
return response()->json($adatok, 200, ["Content-Type" => "application/json"]);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}