Please make sure are you using ->namespace App\Http\Controllers\API; into HintsApiController .
Sep 12, 2019
8
Level 1
I upgrade from 5.6 to 5.7 then all my api not working
after updgrade all my controller under folder API not working but before that its working fine. so i don't know what is happing. this my api route
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/user', function(Request $request) {
return Auth::user();
})->middleware('auth:api');
Route::group(
[
// 'middleware' => 'auth',
'namespace' => '\API'
],
function () {
Route::resource('apiHints', 'HintsApiController');
}
);
so when i hit postman this http://localhost:8000/api/apiHints
i got
Class API\HintsApiController does not exist
then do php artisan config:cache, php artisan config:clear, composer dumpautoload also not work.
Level 28
Aah... okay...
In that case just remove the \ from your original one :)
'namespace' => 'API'
2 likes
Please or to participate in this conversation.