This is my ProductController
public function index()
{
return Product::all();
}
I'm looking a way to return this method from an Inertia request to my Vue component, This is the way I tried this,
routes/web.php
Route::get('/', function () {
return Inertia::render('App', [ProductController::class, 'index']);
});
And here is my Vue component (Not the exact one the way I'm trying to get the data)
<template>
</template>
<script>
props: {
index: Array,
},
</script>