adding products
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/cart', function (Request $request) {
|
||||
return $request->user();
|
||||
return $request->user()->cart();
|
||||
});
|
||||
//})->middleware('auth:sanctum');
|
||||
|
||||
+7
-2
@@ -1,11 +1,16 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Fortify\Features;
|
||||
|
||||
Route::inertia('/', 'Welcome', [
|
||||
/*Route::inertia('/', 'Welcome', [
|
||||
'canRegister' => Features::enabled(Features::registration()),
|
||||
])->name('home');
|
||||
])->name('home');*/
|
||||
|
||||
Route::get('/', fn () => inertia('Home', [
|
||||
'products' => Product::all(),
|
||||
]))->name('home');
|
||||
|
||||
Route::middleware(['auth', 'verified'])->group(function () {
|
||||
Route::inertia('dashboard', 'Dashboard')->name('dashboard');
|
||||
|
||||
Reference in New Issue
Block a user