I have created a new tool within Nova and I have to access my laravel api defined in /routes/api.php
not the one in nova-components/component-name/routes/api.php
My code within the Vue component looks like this:
getCertificateTypes() {
Nova.request().get('/api/certificate-type')
.then(response => {
// my code
});
},
This returns a 401 Unauthorized
This is what I tried so far:
Added this code to my routes() function in the ServiceProvider of the tool created
Route::middleware(['nova', Authorize::class])
->prefix('laravel')
->group(__DIR__.'/../../../routes/api.php');
Now, if I call Nova.request().get('/laravel/api/certificate-type')
I get a 404 not found.
What am I missing here?