<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tito Candra</title>
    <description>The latest articles on DEV Community by Tito Candra (@tcandra24).</description>
    <link>https://dev.to/tcandra24</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F592561%2F1b62b262-ad67-4165-ae0c-42a0235cdfe4.png</url>
      <title>DEV Community: Tito Candra</title>
      <link>https://dev.to/tcandra24</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tcandra24"/>
    <language>en</language>
    <item>
      <title>I Almost Used Nuxt Content for My Blog, but I Chose a Database Instead</title>
      <dc:creator>Tito Candra</dc:creator>
      <pubDate>Sun, 11 Oct 2026 13:49:28 +0000</pubDate>
      <link>https://dev.to/tcandra24/i-almost-used-nuxt-content-for-my-blog-but-i-chose-a-database-instead-568h</link>
      <guid>https://dev.to/tcandra24/i-almost-used-nuxt-content-for-my-blog-but-i-chose-a-database-instead-568h</guid>
      <description>&lt;p&gt;When I started building my personal blog with Nuxt, one of the first decisions I had to make was how to store my content.&lt;/p&gt;

&lt;p&gt;At first, Nuxt Content seemed like a good option. Writing articles in Markdown sounded simple, and I wouldn't need to worry too much about database setup.&lt;/p&gt;

&lt;p&gt;But there was one thing I needed: a custom admin panel where I could manage my articles, categories, and tags.&lt;/p&gt;

&lt;p&gt;That made me reconsider my choice.&lt;/p&gt;

&lt;p&gt;Why I Didn't Choose Nuxt Content&lt;/p&gt;

&lt;p&gt;Nuxt Content is a great option for projects where content lives in files, such as Markdown documents stored in a Git repository.&lt;/p&gt;

&lt;p&gt;However, my blog needed a different workflow.&lt;/p&gt;

&lt;p&gt;I wanted to create and edit articles directly from my admin panel. Since I also planned to deploy the application to a serverless environment, writing Markdown files at runtime wasn't a reliable approach for my setup.&lt;/p&gt;

&lt;p&gt;I didn't want to build my content management system around a storage method that didn't fit how I planned to use the application.&lt;/p&gt;

&lt;p&gt;So, I decided to use a database instead.&lt;/p&gt;

&lt;p&gt;My Choice: PostgreSQL and Drizzle ORM&lt;/p&gt;

&lt;p&gt;I chose PostgreSQL for storing my blog data and Drizzle ORM for working with the database.&lt;/p&gt;

&lt;p&gt;My initial schema included tables for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Articles — titles, content, slugs, publication status, and SEO information.&lt;/li&gt;
&lt;li&gt;Categories — separating tech articles from personal posts.&lt;/li&gt;
&lt;li&gt;Tags — organizing articles by topic.&lt;/li&gt;
&lt;li&gt;Users — storing user information for authentication and administration.&lt;/li&gt;
&lt;li&gt;Comments — leaving room for future discussions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also used a many-to-many relationship between articles and tags, since one article can have multiple tags and one tag can belong to multiple articles.&lt;/p&gt;

&lt;p&gt;This approach gave me more control over how my content was organized and managed.&lt;/p&gt;

&lt;p&gt;Of course, it also meant taking responsibility for database schemas, relationships, migrations, and queries.&lt;/p&gt;

&lt;p&gt;It Was a Trade-Off, Not a Perfect Solution&lt;/p&gt;

&lt;p&gt;Choosing a database didn't automatically make everything easier.&lt;/p&gt;

&lt;p&gt;I had more things to configure and maintain than I would have with a file-based content solution. I also needed to think carefully about my data model before building more features.&lt;/p&gt;

&lt;p&gt;But for my use case, that extra work made sense.&lt;/p&gt;

&lt;p&gt;I wanted a blog that could grow beyond publishing Markdown files. I wanted an admin panel, structured content, authentication, and room for features I might add later.&lt;/p&gt;

&lt;p&gt;Using a database gave me the flexibility I needed for that direction.&lt;/p&gt;

&lt;p&gt;That doesn't mean Nuxt Content is the wrong choice. If your website mainly contains static articles and you enjoy managing content through Git, it may be exactly what you need.&lt;/p&gt;

&lt;p&gt;For my project, though, a database was a better fit.&lt;/p&gt;

&lt;p&gt;What I Learned&lt;/p&gt;

&lt;p&gt;This decision taught me something simple: the best technology isn't always the one with the easiest setup. It's the one that fits the project you're actually building.&lt;/p&gt;

&lt;p&gt;Before choosing a tool, I now try to think beyond the first feature I want to implement.&lt;/p&gt;

&lt;p&gt;How will I manage the content? Where will the application run? What might I need to add later?&lt;/p&gt;

&lt;p&gt;These questions helped me make a decision that felt right for my project, rather than choosing a tool just because it was convenient at the beginning.&lt;/p&gt;

&lt;p&gt;I'm still building and improving this blog, so I expect to revisit some of these decisions as the project grows.&lt;/p&gt;

&lt;p&gt;For now, PostgreSQL and Drizzle ORM are working well for the direction I want to take.&lt;/p&gt;

&lt;p&gt;What about you? When building a blog with Nuxt, would you choose Nuxt Content or a database? I'd love to hear your reasoning.&lt;/p&gt;




&lt;p&gt;This article is part of my Database Series, where I share what I learn about data modeling, database decisions, and building real applications.&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>database</category>
      <category>postgres</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Integrated Better Auth into Nuxt, and the Session Bugs Taught Me More Than I Expected</title>
      <dc:creator>Tito Candra</dc:creator>
      <pubDate>Sat, 10 Oct 2026 09:08:20 +0000</pubDate>
      <link>https://dev.to/tcandra24/i-integrated-better-auth-into-nuxt-and-the-session-bugs-taught-me-more-than-i-expected-gjg</link>
      <guid>https://dev.to/tcandra24/i-integrated-better-auth-into-nuxt-and-the-session-bugs-taught-me-more-than-i-expected-gjg</guid>
      <description>&lt;p&gt;When I started building my blog with Nuxt, I wanted to keep things simple. I needed an authentication system for the admin panel, so I could manage articles, categories, and other content without exposing those features to everyone.&lt;/p&gt;

&lt;p&gt;After looking at my options, I decided to use Better Auth.&lt;/p&gt;

&lt;p&gt;At first, the integration seemed straightforward. I could configure the authentication client, create a login page, and connect it to my admin panel.&lt;/p&gt;

&lt;p&gt;But as I started working with authentication across different pages and layouts, I ran into problems I didn't expect.&lt;/p&gt;

&lt;p&gt;The login request could succeed, but parts of the application still behaved as if I wasn't logged in.&lt;/p&gt;

&lt;p&gt;That was when I realized that getting authentication to work and keeping authentication state consistent across a Nuxt application were two different challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Login Worked, but Something Still Felt Wrong
&lt;/h2&gt;

&lt;p&gt;One of the most confusing problems I encountered was session synchronization.&lt;/p&gt;

&lt;p&gt;Imagine logging into your admin panel successfully. You expect the application to recognize that you're authenticated everywhere, right?&lt;/p&gt;

&lt;p&gt;In my case, that wasn't always what happened.&lt;/p&gt;

&lt;p&gt;The login process could succeed, but another layout or component could still show the old authentication state. In some cases, the UI behaved as if the user hadn't logged in yet.&lt;/p&gt;

&lt;p&gt;Naturally, my first thought was that something was wrong with Better Auth itself.&lt;/p&gt;

&lt;p&gt;I started looking at the authentication flow, checking how the session was retrieved, and investigating why different parts of the application didn't seem to agree about the current user.&lt;/p&gt;

&lt;p&gt;What made this problem tricky was that not everything was actually broken.&lt;/p&gt;

&lt;p&gt;Sometimes, the session existed, but the UI was still using outdated data.&lt;/p&gt;

&lt;p&gt;That distinction changed how I approached the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Started Looking at Nuxt Instead of Just the Authentication Library
&lt;/h2&gt;

&lt;p&gt;Before this experience, I tended to think of authentication as something relatively isolated: send credentials, receive a response, and update the UI.&lt;/p&gt;

&lt;p&gt;Working with Better Auth in Nuxt made me pay more attention to how the framework manages data and application state.&lt;/p&gt;

&lt;p&gt;Nuxt has server-side rendering (SSR), which means parts of the application can run on the server before the resulting HTML reaches the browser.&lt;/p&gt;

&lt;p&gt;It also has its own data-fetching utilities, such as &lt;code&gt;useFetch&lt;/code&gt;, which can reuse cached data.&lt;/p&gt;

&lt;p&gt;These features are useful, but they introduce details that I needed to understand.&lt;/p&gt;

&lt;p&gt;For example, when session data is fetched through Nuxt's data-fetching system, that data doesn't automatically become synchronized across every separate place where I request it.&lt;/p&gt;

&lt;p&gt;If multiple layouts and pages manage their session data independently, they can end up working with different states.&lt;/p&gt;

&lt;p&gt;That helped explain why one part of my application could recognize a successful login while another part still showed the previous state.&lt;/p&gt;

&lt;p&gt;The problem wasn't necessarily the login request. It was how the application handled the session after that request.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Composable Error Taught Me Something Important
&lt;/h2&gt;

&lt;p&gt;I also encountered another issue while integrating Better Auth.&lt;/p&gt;

&lt;p&gt;I initially tried to initialize the authentication client in a regular utility file and access Nuxt's runtime configuration from there.&lt;/p&gt;

&lt;p&gt;Something like this looked reasonable to me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useRuntimeConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, Nuxt composables such as &lt;code&gt;useRuntimeConfig()&lt;/code&gt; and &lt;code&gt;useNuxtApp()&lt;/code&gt; need the appropriate Nuxt context.&lt;/p&gt;

&lt;p&gt;Calling them at the top level of a regular module doesn't guarantee that this context will be available.&lt;/p&gt;

&lt;p&gt;The result was an error telling me that a composable requiring access to the Nuxt instance had been called outside that context.&lt;/p&gt;

&lt;p&gt;At first, this felt like one of those framework-specific issues that was difficult to understand without spending time reading and experimenting.&lt;/p&gt;

&lt;p&gt;Eventually, I learned to think differently about where application code should be initialized.&lt;/p&gt;

&lt;p&gt;A regular utility function, a Nuxt composable, and a Nuxt plugin might all contain TypeScript code, but they don't necessarily run in the same context.&lt;/p&gt;

&lt;p&gt;Moving the authentication client initialization into a Nuxt plugin gave it the appropriate place to access runtime configuration and expose the client to the rest of the application.&lt;/p&gt;

&lt;p&gt;It was a small change in code organization, but it helped me understand Nuxt's conventions much better.&lt;/p&gt;

&lt;p&gt;I also became more careful about which code should run on the server and which code should run in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Biggest Lesson: One Source of Truth Matters
&lt;/h2&gt;

&lt;p&gt;The session synchronization issue eventually led me to reconsider how I managed authentication state.&lt;/p&gt;

&lt;p&gt;Instead of treating every layout and page as an independent place to retrieve the session, I started thinking about authentication as shared application state.&lt;/p&gt;

&lt;p&gt;Nuxt provides &lt;code&gt;useState()&lt;/code&gt; for sharing reactive state in an SSR-friendly way.&lt;/p&gt;

&lt;p&gt;For my case, the idea was simple: keep the session in one shared state, let the relevant components read from it, and update that state when authentication changes.&lt;/p&gt;

&lt;p&gt;After a successful sign-in or sign-out, the session needs to be refreshed so the rest of the application can reflect the new state.&lt;/p&gt;

&lt;p&gt;This approach made more sense to me than allowing each component to maintain its own potentially outdated version of the session.&lt;/p&gt;

&lt;p&gt;There was still an important detail to consider: shared state doesn't automatically guarantee that the session is initialized correctly. The initial session needs to be resolved at the appropriate time, especially when server-side rendering is involved.&lt;/p&gt;

&lt;p&gt;But the overall design became clearer once I stopped treating session data as something every component should independently figure out.&lt;/p&gt;

&lt;p&gt;It wasn't just about making the login page work anymore. It was about deciding which part of the application should own the authentication state and how other parts should consume it.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSR Added Another Layer to the Problem
&lt;/h2&gt;

&lt;p&gt;Another thing I learned was that server-side rendering changes how I think about requests and authentication.&lt;/p&gt;

&lt;p&gt;When a user visits a page, Nuxt may render that page on the server. That server-side code can make its own requests, but it doesn't automatically behave exactly like code running in the user's browser.&lt;/p&gt;

&lt;p&gt;For example, browser cookies are important when checking an existing session. When handling an internal server-side request, I needed to pay attention to whether the relevant cookie headers were being forwarded.&lt;/p&gt;

&lt;p&gt;I also had to think about the authentication client's base URL. A relative URL that works naturally in the browser might not be sufficient in a server-side context.&lt;/p&gt;

&lt;p&gt;These details were easy to overlook when I was focused only on the sign-in form.&lt;/p&gt;

&lt;p&gt;They also helped me understand why authentication problems in SSR applications can be confusing: the browser, the server, the authentication library, and Nuxt's data-fetching system all play different roles.&lt;/p&gt;

&lt;p&gt;Once I started separating those responsibilities, debugging became more systematic.&lt;/p&gt;

&lt;p&gt;Instead of immediately changing the authentication configuration, I could ask more specific questions.&lt;/p&gt;

&lt;p&gt;Was the login request successful? Was the session cookie present? Was the server receiving the expected headers? Was the session actually stale, or was the UI simply showing outdated data?&lt;/p&gt;

&lt;p&gt;Those questions gave me a much better starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Took Away From This Experience
&lt;/h2&gt;

&lt;p&gt;I didn't expect authentication to teach me so much about how Nuxt works internally.&lt;/p&gt;

&lt;p&gt;Looking back, the most useful lessons weren't about memorizing a particular Better Auth configuration.&lt;/p&gt;

&lt;p&gt;They were about understanding the environment in which my code runs and how application state moves through the system.&lt;/p&gt;

&lt;p&gt;Here are a few things I'm taking forward into my next projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Successful requests don't always mean the UI is up to date.&lt;/strong&gt; I need to distinguish between a backend problem and a frontend state synchronization problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nuxt composables need the right context.&lt;/strong&gt; Where code is initialized matters, especially when working with runtime configuration and third-party libraries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSR introduces responsibilities that browser-only applications may not have.&lt;/strong&gt; Cookies, request headers, and server-side URLs deserve more attention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared state needs a clear owner.&lt;/strong&gt; When several components depend on the same authentication session, they should not become disconnected sources of truth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging gets easier when I investigate one layer at a time.&lt;/strong&gt; Checking the request, cookie, server response, and UI state separately is more useful than assuming everything is an authentication failure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm still learning Nuxt, and I know there are more details to explore. But this experience gave me a better mental model of how authentication and SSR interact.&lt;/p&gt;

&lt;p&gt;More importantly, it reminded me that integrating a library into a framework is about more than getting the initial setup right. I also need to understand how that library fits into the framework's existing lifecycle, state management, and rendering behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building this blog has been a useful way to learn Nuxt beyond the basics.&lt;/p&gt;

&lt;p&gt;I could have studied plugins, &lt;code&gt;useState()&lt;/code&gt;, SSR, and data fetching separately. But encountering a real problem made the connections between them much easier to understand.&lt;/p&gt;

&lt;p&gt;The authentication bugs were frustrating at first, but they pushed me to look beyond the login form and think about how the application behaved as a whole.&lt;/p&gt;

&lt;p&gt;That's something I want to keep doing as I learn new technologies: build something real, pay attention when things don't work as expected, and share what I learn along the way.&lt;/p&gt;

&lt;p&gt;I'm curious how other Nuxt developers handle authentication state across layouts and pages, especially in applications that rely heavily on SSR.&lt;/p&gt;

&lt;p&gt;Do you prefer a shared session composable, or do you use a different approach?&lt;/p&gt;

&lt;p&gt;I'd love to hear what has worked for you.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article is part of my journey of learning Nuxt by building a real project and sharing the lessons I discover along the way.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>vue</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Rahasia Laravel yang Bikin Kode Kamu Makin Ciamik – Pahami Trait Sekali, Langsung Ahli!</title>
      <dc:creator>Tito Candra</dc:creator>
      <pubDate>Thu, 30 Oct 2025 06:14:04 +0000</pubDate>
      <link>https://dev.to/tcandra24/rahasia-laravel-yang-bikin-kode-kamu-makin-ciamik-pahami-trait-sekali-langsung-ahli-18pm</link>
      <guid>https://dev.to/tcandra24/rahasia-laravel-yang-bikin-kode-kamu-makin-ciamik-pahami-trait-sekali-langsung-ahli-18pm</guid>
      <description>&lt;p&gt;&lt;strong&gt;Apa itu Trait di Laravel?&lt;/strong&gt;&lt;br&gt;
Trait bukan hal mistis, tapi sekadar cara cerdas di PHP untuk menghindari penulisan kode berulang. Trait adalah sekumpulan method yang bisa dibagikan ke beberapa kelas, bagaikan ‘paket fungsi’ yang bisa dipakai ulang kapan saja tanpa perlu turunan kelas yang ribet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kenapa Trait Berguna?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Kode reuse&lt;/strong&gt;: trait memungkinkan kamu menulis satu set method sekali, dan gunakan lagi di banyak kelas - hematin waktu dan tenaga.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Menghindari keterbatasan pewarisan tunggal (single inheritance)&lt;/strong&gt; PHP - tidak perlu extends berkali-kali.&lt;/li&gt;
&lt;li&gt;Ibarat “ambil fungsi pakai trait” - langsung jadi tanpa ulang bikin ulang.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cara Membuat dan Menggunakan Trait di Laravel (ramah untuk pemula)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Buat folder trait&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Biasanya ditempatkan di: &lt;em&gt;app/Traits&lt;/em&gt; atau &lt;em&gt;app/Models/Traits&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Buat file trait&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Contoh membuat trait ExampleTrait:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
namespace App\Traits;

trait ExampleTrait {
    public function exampleMethod() {
        return 'Ini contoh method dari Trait!';
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pakai trait di kelas lain&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Misalnya di controller atau model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
namespace App\Http\Controllers;
use App\Traits\ExampleTrait;

class HomeController extends Controller {
    use ExampleTrait;

    public function index() {
        return $this-&amp;gt;exampleMethod();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kalau kamu akses method tersebut, hasilnya: &lt;strong&gt;“Ini contoh method dari Trait!”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips Tambahan&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resolusi Konflik Nama Method
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use TraitA, TraitB {
    TraitA::methodName insteadof TraitB;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Buat Trait dengan Fungsi Reusable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Contoh trait &lt;em&gt;ResponseTrait&lt;/em&gt; untuk API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trait ResponseTrait {
    public function successResponse($data = [], $message = 'success', $code = 200) {
        return response()-&amp;gt;json(compact('data', 'message'), $code);
    }

    public function errorResponse($message, $code = 400) {
        return response()-&amp;gt;json(compact('message'), $code);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Trait di Eloquent Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Trait bisa berisi relasi atau method yang sering dipakai di model. Contohnya:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HasRoles&lt;/strong&gt; dari Spatie: trait yang memungkinkan model punya relasi roles().&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HasTags&lt;/strong&gt;: terasa seperti fitur tagging—attach, detach tag cukup panggil method di model yang sudah pakai trait.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rangkuman Sederhana&lt;br&gt;
Membuat Trait: Buat file di app/Traits, tulis trait NamaTrait { ... }&lt;br&gt;
Gunakan: use NamaTrait; dalam kelas yang butuh method-nya&lt;br&gt;
Pakai Lagi: Bisa di banyak kelas untuk fungsi sama&lt;br&gt;
Kalau conflict: Atur dengan insteadof atau as agar tidak tabrakan method&lt;br&gt;
Contoh Praktis: Response format, UUID auto_pk, relasi model, dll&lt;/p&gt;

&lt;p&gt;Sumber Referensi:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definisi dan konsep trait PHP: manual resmi PHP &lt;a href="https://www.php.net/manual/en/language.oop5.traits.php" rel="noopener noreferrer"&gt;php.link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Penggunaan dasar trait di Laravel: Medium &amp;amp; DEV guides &lt;a href="https://dev.to/dharmik225/mastering-traits-the-first-step-to-clean-efficient-laravel-code-48l2"&gt;Medium+1DEV Community&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Contoh trait di Eloquent (HasRoles &amp;amp; HasTags): Laravel Daily &lt;a href="https://laraveldaily.com/post/traits-laravel-eloquent-examples" rel="noopener noreferrer"&gt;Laravel Daily&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Trait otomatis UUID untuk model: David Carr Blog &lt;a href="https://dcblog.dev/enhancing-laravel-applications-with-traits-a-step-by-step-guide" rel="noopener noreferrer"&gt;dcblog.dev&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rangkuman Sederhana&lt;/p&gt;

&lt;p&gt;Gunakan di controller base agar semua controller turunannya punya format respons yang seragam.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Memperbaiki Error 0x0000011b Windows 10 Sharing Printer</title>
      <dc:creator>Tito Candra</dc:creator>
      <pubDate>Sun, 06 Apr 2025 03:19:01 +0000</pubDate>
      <link>https://dev.to/tcandra24/memperbaiki-error-0x0000011b-windows-10-sharing-printer-383i</link>
      <guid>https://dev.to/tcandra24/memperbaiki-error-0x0000011b-windows-10-sharing-printer-383i</guid>
      <description>&lt;p&gt;Hallo teman,&lt;br&gt;
Disini saya akan share pengalaman pribadi saat troubleshooting printer yang mempunyai error &lt;strong&gt;0x0000011b&lt;/strong&gt;, error ini sering muncul saat ingin melakukan sharing printer pada &lt;strong&gt;Windows 10&lt;/strong&gt;. Error tersebut disebabkan oleh update terbaru &lt;strong&gt;Windows 10 2021-09 Cumulative Update for Windows 10 Version 21H1 for x64-based Systems (KB5005565)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Terkadang update windows bisa menciptakan manfaat dan kerugian, dalam kasus yang saya alami adalah printer telah terinstall pada komputer &lt;strong&gt;Windows 10&lt;/strong&gt; kemudian printer tersebut di share ke semua pengguna lain. error ini muncul jika ada komputer client menggunakan &lt;strong&gt;Windows 7&lt;/strong&gt; yang mencoba melakukan koneksi dengan printer tadi, jika komputer client sama-sama menggunakan windows 10 mungkin error ini tidak akan muncul.&lt;/p&gt;

&lt;p&gt;lalu bagaimana memperbaikinya, mudah sekali coba ikuti langkah-langkah dibawah ini:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Buka regedit pada komputer server printer atau pada &lt;strong&gt;Windows 10&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Kemudian arahkan direktori ke &lt;strong&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Kemudian buat &lt;strong&gt;DWORD-32&lt;/strong&gt; baru dengan nama &lt;strong&gt;RpcAuthnLevelPrivacyEnabled&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Value&lt;/strong&gt; Data menjadi 0&lt;/li&gt;
&lt;li&gt;Kemudian Restart PC / Server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Setelah Komputer / Server menyala kembali, coba untuk menyambungkan ulang pada printer menggunakan komputer client yang menggunakan &lt;strong&gt;Windows 7&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Semoga membantu.&lt;br&gt;
Terima Kasih&lt;/p&gt;

&lt;p&gt;Referensi:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://bptsi.unisayogya.ac.id/fix-error-kode-error-0x0000011b-windows-10-sharing-printer/" rel="noopener noreferrer"&gt;https://bptsi.unisayogya.ac.id/fix-error-kode-error-0x0000011b-windows-10-sharing-printer/&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>microsoft</category>
      <category>printer</category>
      <category>windows</category>
      <category>troubleshooting</category>
    </item>
  </channel>
</rss>
