答案 0 :(得分:2)
您的API路径应为:
Route::get('/api/usertype/{id}', 'HomeController@getUsertype');
您的API控制器:
use DB;
/** You have pass user_type_id **/
public function getUsertype($id){
$user = DB::table('users')
->where('user_type_id', $id)
->select('users.*')
->get();
dd($user);
}