This is a function that reads a setting data from DB.
public function getSetting(Request $request)
{
$user = Auth::user();
$tableName = $request->name;
$setting = \DB::table($tableName)->where('id', $user->id)->first();
return response()->json($setting, '200', ['Content-Type' => 'application/json','Charset' => 'utf-8'], JSON_UNESCAPED_UNICODE);
}
Do you think it is okay to put the table name from GET parameter.