It might be because it is listed in the web.php file, as that's not an API route at all :)
or just check your routes folder and make sure there is no additional file in there that loads those routes.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello this is strange that I cannot find where the api is located?
methods : {
getSku: function () {
axios
.get('/productInventory/get-all-sku')
.then(response => {
this.list_sku = response.data;
});
},
If I type on the browser: http://127.0.0.1:8000/productInventory/get-all-sku
I can see the api.
As far as I know all api address should be listed here:
routes/api.php
<?php
use Illuminate\Http\Request;
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::get('/search', 'SearchController@index')->name('cari.barang');
Route::get('/checkphone', 'SearchController@checkPhone')->name('cari.telepon');
Route::get('/checkemail', 'SearchController@checkEmail')->name('cari.email');
//product or price
Route::get('/stock/{priceId}', 'StockController@checkStock')->name('cari.email');
I wonder why this api : .get('/productInventory/get-all-sku')
Is not listed in the routes/api.php and still works just fine?
@davy_yg good job understanding that :)
So you see in the RouteServiceProvider of the module this part:
protected $moduleNamespace = 'Modules\ProductInventory\Http\Controllers';
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(__DIR__ . '/../Routes/web.php');
This tells it to load the controllers from that namespace. So when you say in the route ProductInventoryController
It will try to find the controller in: 'Modules\ProductInventory\Http\Controllers\ProductInventoryController.php'.
Please or to participate in this conversation.