I have question regarding registering the api on the route.php I got an error accessing my api that I already created on the route.php
Class App\Http\Controllers/api/UserController does not exist
I create api folder I named it as api inside Controllers/api I create UserController.php
My Function:
public function index() {
$table_slider = DB::select('SELECT content_id,link,file,slider_sorting,content_pages FROM content_structure as cs LEFT JOIN (SELECT cid,file FROM content_upload_assets) cua ON cs.content_id = cua.cid WHERE content_pages = ? AND cs.status = ? ORDER BY content_id DESC ',[
'Slider',
'Active'
]);
return response()->json($table_slider);
}
On my api.php
Route::get('index','/api/UserController@index');
To solved the issue I used this route.
Route::get('index','api\UserController@index')