['products' => function($query){ $query->paginate(2)->withQueryString()->links(); notworking code example
Example: laravel pagination keep query string
$result->appends(request()->query())->links()
$result->appends(request()->query())->links()