Obtenga los últimos 30 días de registros en Laravel

use Carbon\Carbon;

$users = DB::table("users")
    ->select('id')
    ->where('accounttype', 'standard')
    ->where('created_at', '>', now()->subDays(30)->endOfDay())
    ->all();
Sharifur Robin