Laravel

controller

Verzeichnis

app/HTTP/Controllers

controller anlegen

php artisan make:controller Name

Datenbankabfragen

$data = Product::all();
$data = Product::where('id', 1)->get();
$data = Product::where('price', '>', 7)->get();
$data = Product::where('price', '>', 3)->orderby('price', 'desc')->get();
$data = Product::where('price', '>', 3)->where('price', '<', 10)->orderby('price', 'desc')->get();
$data = Product::whereRaw('price > 5 AND price < 10')->orderby('price', 'desc')->get();

return

return view('product', compact('data'));