1:"$Sreact.fragment" 2:I[2199,[],""] 3:I[2523,[],""] 5:I[3253,[],"MetadataBoundary"] 7:I[3253,[],"OutletBoundary"] a:I[5731,[],"AsyncMetadataOutlet"] c:I[3253,[],"ViewportBoundary"] e:I[1666,[],""] :HL["/_next/static/media/e4af272ccee01ff0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/_next/static/css/baf6d4a8f27c2bfb.css","style"] 0:{"P":null,"b":"bAnUhWWJ5_fOi8h8TxCbE","p":"","c":["","blog","building-scalable-apis-laravel"],"i":false,"f":[[["",{"children":["blog",{"children":[["slug","building-scalable-apis-laravel","d"],{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/baf6d4a8f27c2bfb.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"dark scroll-smooth","children":["$","body",null,{"className":"__variable_f367f3 min-h-screen bg-background font-sans text-foreground antialiased before:fixed before:inset-0 before:z-0 before:bg-tech-grid before:[mask-image:radial-gradient(ellipse_at_top,black_40%,transparent_80%)] before:pointer-events-none","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["blog",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["slug","building-scalable-apis-laravel","d"],["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":["$L4",["$","$L5",null,{"children":"$L6"}],null,["$","$L7",null,{"children":["$L8","$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,["$","$1","Z3UsTpXgs09Fx1oH-trBg",{"children":[["$","$Lc",null,{"children":"$Ld"}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],null]}],false]],"m":"$undefined","G":["$e","$undefined"],"s":false,"S":true} f:"$Sreact.suspense" 10:I[5731,[],"AsyncMetadata"] 12:I[7758,["758","static/chunks/758-b4e4913f67627b5c.js","723","static/chunks/723-a2cd1bbf256debde.js","953","static/chunks/app/blog/%5Bslug%5D/page-cea8a6766764d7f6.js"],""] 13:I[8723,["758","static/chunks/758-b4e4913f67627b5c.js","723","static/chunks/723-a2cd1bbf256debde.js","953","static/chunks/app/blog/%5Bslug%5D/page-cea8a6766764d7f6.js"],"Image"] 6:["$","$f",null,{"fallback":null,"children":["$","$L10",null,{"promise":"$@11"}]}] 4:["$","div",null,{"className":"relative z-10 min-h-screen","children":[["$","div",null,{"className":"fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-xl border-b border-border","children":["$","div",null,{"className":"container flex h-14 items-center justify-between","children":[["$","$L12",null,{"href":"/","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-accent hover:text-foreground h-9 rounded-lg px-3.5 text-xs gap-2","children":[["$","svg",null,{"ref":"$undefined","xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-arrow-left size-4","children":[["$","path","1l729n",{"d":"m12 19-7-7 7-7"}],["$","path","x3x0zl",{"d":"M19 12H5"}],"$undefined"]}],"Back"],"ref":null,"disabled":"$undefined"}],["$","span",null,{"className":"text-sm text-muted-foreground","children":"Blog"}]]}]}],["$","article",null,{"className":"pt-24 pb-24","children":["$","div",null,{"className":"container max-w-3xl","children":[["$","header",null,{"className":"mb-10","children":[["$","div",null,{"className":"flex items-center gap-3 text-sm text-muted-foreground mb-6","children":[["$","span",null,{"className":"inline-flex items-center gap-1.5","children":[["$","svg",null,{"ref":"$undefined","xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-calendar size-3.5","children":[["$","path","1cmpym",{"d":"M8 2v4"}],["$","path","4m81vk",{"d":"M16 2v4"}],["$","rect","1hopcy",{"width":"18","height":"18","x":"3","y":"4","rx":"2"}],["$","path","8toen8",{"d":"M3 10h18"}],"$undefined"]}],"Jul 12, 2026"]}],["$","span",null,{"className":"inline-flex items-center gap-1.5","children":[["$","svg",null,{"ref":"$undefined","xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-clock size-3.5","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","polyline","68esgv",{"points":"12 6 12 12 16 14"}],"$undefined"]}],"6 min read"]}]]}],["$","h1",null,{"className":"text-3xl font-bold tracking-tight sm:text-4xl md:text-5xl text-balance","children":"Building Scalable APIs with Laravel"}],["$","div",null,{"className":"flex flex-wrap gap-1.5 mt-5","children":[["$","div","Laravel",{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 text-xs","children":"Laravel"}],["$","div","PHP",{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 text-xs","children":"PHP"}],["$","div","API",{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 text-xs","children":"API"}]]}]]}],["$","div",null,{"className":"relative w-full aspect-[2/1] rounded-xl overflow-hidden mb-12 border border-border","children":[["$","$L13",null,{"src":"https://images.unsplash.com/photo-1558494949-ef010cbdcc31?w=800&h=400&fit=crop","alt":"Server racks with LED lights","fill":true,"className":"object-cover","priority":true}],["$","div",null,{"className":"absolute inset-0 bg-gradient-to-t from-background/40 to-transparent"}]]}],["$","div",null,{"className":"prose prose-invert max-w-none","children":[["$","p","0",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"Building APIs that can handle growing traffic is one of the most critical skills for a backend developer. Laravel provides an excellent foundation with its expressive syntax, built-in rate limiting, and robust queue system."}],["$","h2","1",{"className":"text-2xl font-bold tracking-tight mt-12 mb-4","children":"Request Validation"}],["$","p","2",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"The first line of defense for any API is proper request validation. Laravel's Form Request classes make this incredibly straightforward. Instead of cluttering your controllers with validation logic, you can create dedicated request classes that handle both authorization and validation."}],["$","div","3",{"className":"relative rounded-xl border border-border bg-[#0D0D10] my-6 overflow-hidden","children":[["$","div",null,{"className":"flex items-center gap-1.5 px-4 py-2.5 border-b border-border/50","children":[["$","span",null,{"className":"size-2.5 rounded-full bg-[#FF5F56]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#FFBD2E]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#27C93F]"}]]}],["$","pre",null,{"className":"p-4 overflow-x-auto text-sm font-mono leading-relaxed text-muted-foreground","children":["$","code",null,{"children":"class StorePostRequest extends FormRequest\n{\n public function rules(): array\n {\n return [\n 'title' => 'required|string|max:255',\n 'content' => 'required|string',\n 'tags' => 'array',\n 'tags.*' => 'exists:tags,id',\n ];\n }\n}"}]}]]}],["$","p","4",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"This approach keeps your controllers clean and your validation logic testable and reusable."}],["$","h2","5",{"className":"text-2xl font-bold tracking-tight mt-12 mb-4","children":"Rate Limiting"}],["$","p","6",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"Laravel's built-in rate limiting with Redis is powerful yet simple to configure. You can define different limits for different endpoints or user roles."}],["$","div","7",{"className":"relative rounded-xl border border-border bg-[#0D0D10] my-6 overflow-hidden","children":[["$","div",null,{"className":"flex items-center gap-1.5 px-4 py-2.5 border-b border-border/50","children":[["$","span",null,{"className":"size-2.5 rounded-full bg-[#FF5F56]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#FFBD2E]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#27C93F]"}]]}],["$","pre",null,{"className":"p-4 overflow-x-auto text-sm font-mono leading-relaxed text-muted-foreground","children":["$","code",null,{"children":"RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(\n $request->user()?->id ?: $request->ip()\n );\n});"}]}]]}],["$","h2","8",{"className":"text-2xl font-bold tracking-tight mt-12 mb-4","children":"Caching Strategies"}],["$","p","9",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"For read-heavy APIs, caching is essential. I recommend a layered approach: use Laravel's Cache facade with Redis for frequently accessed data, implement HTTP cache headers for browser-level caching, and consider a CDN for static resources."}],["$","div","10",{"className":"relative rounded-xl border border-border bg-[#0D0D10] my-6 overflow-hidden","children":[["$","div",null,{"className":"flex items-center gap-1.5 px-4 py-2.5 border-b border-border/50","children":[["$","span",null,{"className":"size-2.5 rounded-full bg-[#FF5F56]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#FFBD2E]"}],["$","span",null,{"className":"size-2.5 rounded-full bg-[#27C93F]"}]]}],["$","pre",null,{"className":"p-4 overflow-x-auto text-sm font-mono leading-relaxed text-muted-foreground","children":["$","code",null,{"children":"$$posts = Cache::remember('posts.recent', 3600, function () {\n return Post::with('author')\n ->latest()\n ->take(20)\n ->get();\n});"}]}]]}],["$","h2","11",{"className":"text-2xl font-bold tracking-tight mt-12 mb-4","children":"Key Takeaways"}],["$","p","12",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"- Use Form Requests for clean validation"}],["$","p","13",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"- Implement rate limiting early — it's easier than retrofitting"}],["$","p","14",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"- Cache aggressively but invalidate carefully"}],["$","p","15",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"- Monitor your API with tools like Laravel Telescope"}],["$","p","16",{"className":"text-base leading-relaxed text-muted-foreground my-4","children":"Building scalable APIs is an ongoing journey. Start with these foundations and iterate based on real traffic patterns."}]]}],["$","div",null,{"className":"mt-16 pt-8 border-t border-border","children":["$","div",null,{"className":"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4","children":[["$","$L12",null,{"href":"/","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-muted-foreground hover:bg-accent hover:text-foreground h-9 rounded-lg px-3.5 text-xs gap-2","children":[["$","svg",null,{"ref":"$undefined","xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-arrow-left size-4","children":[["$","path","1l729n",{"d":"m12 19-7-7 7-7"}],["$","path","x3x0zl",{"d":"M19 12H5"}],"$undefined"]}],"Back to Home"],"ref":null,"disabled":"$undefined"}],["$","div",null,{"className":"flex gap-2","children":[["$","$L12","modern-frontend-nextjs-app-router",{"href":"/blog/modern-frontend-nextjs-app-router","children":["Modern Frontend with Next.js A","..."],"className":"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-white/10 bg-white/5 text-foreground backdrop-blur-sm hover:bg-white/10 hover:border-white/20 hover:shadow-lg hover:shadow-cyan-500/10 h-9 rounded-lg px-3.5 text-xs","ref":null,"disabled":"$undefined"}],["$","$L12","dotnet-core-microservices",{"href":"/blog/dotnet-core-microservices","children":["Getting Started with .NET Core","..."],"className":"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-white/10 bg-white/5 text-foreground backdrop-blur-sm hover:bg-white/10 hover:border-white/20 hover:shadow-lg hover:shadow-cyan-500/10 h-9 rounded-lg px-3.5 text-xs","ref":null,"disabled":"$undefined"}]]}]]}]}]]}]}]]}] 9:null d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] 8:null 11:{"metadata":[["$","title","0",{"children":"Building Scalable APIs with Laravel — Tio Setiawan"}],["$","meta","1",{"name":"description","content":"Deep dive into designing RESTful APIs that scale — from request validation to rate limiting and caching strategies."}],["$","meta","2",{"property":"og:title","content":"Tio Setiawan — Software Engineer"}],["$","meta","3",{"property":"og:description","content":"Software Engineer specializing in building scalable, user-friendly web applications."}],["$","meta","4",{"property":"og:type","content":"website"}],["$","meta","5",{"name":"twitter:card","content":"summary"}],["$","meta","6",{"name":"twitter:title","content":"Tio Setiawan — Software Engineer"}],["$","meta","7",{"name":"twitter:description","content":"Software Engineer specializing in building scalable, user-friendly web applications."}],["$","link","8",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]],"error":null,"digest":"$undefined"} b:{"metadata":"$11:metadata","error":null,"digest":"$undefined"}