[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-settings":3,"blog-post:laravel-eloquent-relationships":8,"blog-comments:76717847-4080-4ae6-a2d8-b35badc46be3":31,"blog-posts-latest:24":32,"site-content":325},{"id":4,"accent_theme":5,"font_theme":6,"updated_at":7},1,"midnight","saas","2026-10-28T07:05:59.308034+00:00",{"id":9,"title":10,"slug":11,"excerpt":12,"content":13,"cover_image":14,"meta_title":15,"meta_description":16,"og_image":17,"tags":18,"status":24,"published_at":25,"view_count":26,"deleted_at":27,"deleted_reason":28,"created_at":29,"updated_at":30},"76717847-4080-4ae6-a2d8-b35badc46be3","Laravel Eloquent Relationships","laravel-eloquent-relationships","Laravel Eloquent relationships map how models connect — hasMany, belongsTo, belongsToMany, and more. Define them once, then load related rows with with() instead of stuffing joins into every query.","\u003Ch2 id=\"quick-answer\">Quick Answer\u003C\u002Fh2>\n\u003Cp>Laravel Eloquent relationships are methods on your models that describe how tables connect: a post has many comments, a comment belongs to a post, a user belongs to many roles. You use them when related rows should come back as objects, not as a pile of join columns. Define the relation once, then load it with \u003Ccode>with()\u003C\u002Fcode> so you are not firing a query per row.\u003C\u002Fp>\n\n\u003Ch2 id=\"quick-facts\">Quick Facts\u003C\u002Fh2>\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>Item\u003C\u002Fth>\u003Cth>Details\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Topic\u003C\u002Ftd>\u003Ctd>Laravel Eloquent Relationships\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Category\u003C\u002Ftd>\u003Ctd>Laravel \u002F PHP \u002F Eloquent\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Cnav class=\"blog-toc\" aria-label=\"Table of contents\">\n\u003Ch2 id=\"table-of-contents\">Table of Contents\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"#what-is-laravel-eloquent-relationships\">What Is Laravel Eloquent Relationships?\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#why-it-matters\">Why It Matters\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#how-it-works\">How It Works\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#step-by-step-guide\">Step-by-Step Guide\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#real-world-example\">Real-World Example\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#pros-cons\">Pros &amp; Cons\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#best-practices\">Best Practices\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#common-mistakes\">Common Mistakes\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#frequently-asked-questions\">FAQs\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#key-takeaways\">Key Takeaways\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fnav>\n\n\u003Ch2 id=\"what-is-laravel-eloquent-relationships\">What Is Laravel Eloquent Relationships?\u003C\u002Fh2>\n\u003Cp>This is not Query Builder \u003Ccode>join()\u003C\u002Fcode>. A join returns a flat row. A relationship returns another model — or a collection of them — with its own methods, casts, and nested relations.\u003C\u002Fp>\n\u003Cp>Eloquent infers a lot from names. \u003Ccode>Post\u003C\u002Fcode> has many \u003Ccode>Comment\u003C\u002Fcode> models, so it looks for \u003Ccode>comments.post_id\u003C\u002Fcode> unless you pass custom keys. That convention is why a one-line method works, and why a renamed column silently returns empty collections.\u003C\u002Fp>\n\u003Cp>If you already live in Laravel, this is the layer you touch every day: posts and authors, orders and items, users and roles. If you are coming from raw SQL, think of it as a named, reusable join that hydrates models instead of arrays.\u003C\u002Fp>\n\n\u003Ch2 id=\"why-it-matters\">Why It Matters\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Queries stay in one place\u003C\u002Fstrong> — change the foreign key once on the relation, not in every controller.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>N+1 shows up in the log, not in “random slowness”\u003C\u002Fstrong> — \u003Ccode>with()\u003C\u002Fcode> and \u003Ccode>withCount()\u003C\u002Fcode> are the difference between 2 queries and 200.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Nested data is boring to assemble by hand\u003C\u002Fstrong> — \u003Ccode>$post-&gt;author-&gt;name\u003C\u002Fcode> beats stitching arrays after a three-table join.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2 id=\"how-it-works\">How It Works\u003C\u002Fh2>\n\u003Cp>Eloquent does not store a graph in the database. It stores foreign keys (or a pivot table). The relationship method is a query factory: call it as a method to keep chaining, or as a property to run the query and cache the result on the model.\u003C\u002Fp>\n\u003Cfigure class=\"blog-figure blog-figure--diagram\" contenteditable=\"false\">\n\u003Cdiv class=\"blog-mermaid\">\n\u003Cpre class=\"mermaid-source\">flowchart LR\n  U[users] -->|hasMany user_id| P[posts]\n  P -->|hasMany post_id| C[comments]\n  C -->|belongsTo| P\n  P -->|belongsToMany| PT[post_tag]\n  T[tags] -->|belongsToMany| PT\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\u003Cfigcaption>Foreign keys live on the child table. Many-to-many goes through a pivot, not a JSON list of ids.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>\n\u003Col>\n\u003Cli>\u003Cstrong>Keys\u003C\u002Fstrong> — \u003Ccode>hasMany\u003C\u002Fcode> \u002F \u003Ccode>belongsTo\u003C\u002Fcode> use a column like \u003Ccode>post_id\u003C\u002Fcode>. \u003Ccode>belongsToMany\u003C\u002Fcode> uses a pivot (\u003Ccode>post_tag\u003C\u002Fcode>) with two foreign keys. Morphs add \u003Ccode>commentable_type\u003C\u002Fcode> + \u003Ccode>commentable_id\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The method vs the property\u003C\u002Fstrong> — \u003Ccode>$post-&gt;comments()\u003C\u002Fcode> is a query you can still constrain. \u003Ccode>$post-&gt;comments\u003C\u002Fcode> executes it. Mix them up and you either hit the database twice or wonder why \u003Ccode>where()\u003C\u002Fcode> is missing.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Lazy vs eager\u003C\u002Fstrong> — accessing the property with no preload runs one query per parent. \u003Ccode>Post::with('comments')\u003C\u002Fcode> runs two: all posts, then all comments for those ids. Same data, different query count.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cfigure class=\"blog-figure blog-figure--diagram\" contenteditable=\"false\">\n\u003Cdiv class=\"blog-mermaid\">\n\u003Cpre class=\"mermaid-source\">flowchart TB\n  subgraph one [hasMany - one parent]\n    P1[posts] --> C1[comments.post_id]\n  end\n  subgraph many [belongsToMany - both sides]\n    P2[posts] --> PV[post_tag]\n    TG[tags] --> PV\n  end\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\u003Cfigcaption>hasMany: child row points at one parent. belongsToMany: both sides can have many; the pivot holds the pair.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>\n\u003Cp>The six you will actually type:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>hasOne\u003C\u002Fcode> \u002F \u003Ccode>belongsTo\u003C\u002Fcode> — profile belongs to user; user has one profile.\u003C\u002Fli>\n\u003Cli>\u003Ccode>hasMany\u003C\u002Fcode> \u002F \u003Ccode>belongsTo\u003C\u002Fcode> — post has many comments; comment belongs to post.\u003C\u002Fli>\n\u003Cli>\u003Ccode>belongsToMany\u003C\u002Fcode> — posts and tags. Pivot can hold extra columns (\u003Ccode>withPivot\u003C\u002Fcode>, \u003Ccode>withTimestamps\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>\u003Ccode>hasManyThrough\u003C\u002Fcode> — country → users → posts without a direct \u003Ccode>country_id\u003C\u002Fcode> on posts.\u003C\u002Fli>\n\u003Cli>\u003Ccode>morphTo\u003C\u002Fcode> \u002F \u003Ccode>morphMany\u003C\u002Fcode> — comments that can hang off posts \u003Cem>or\u003C\u002Fem> projects.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2 id=\"step-by-step-guide\">Step-by-Step Guide\u003C\u002Fh2>\n\u003Ch3 id=\"step-1\">Step 1: Put the foreign key on the child table\u003C\u002Fh3>\n\u003Cp>Migration first. Parent table has no array of child ids. Comments hold \u003Ccode>post_id\u003C\u002Fcode>. For tags, create \u003Ccode>post_tag\u003C\u002Fcode> with \u003Ccode>post_id\u003C\u002Fcode> and \u003Ccode>tag_id\u003C\u002Fcode> (and a unique index on the pair so you cannot attach the same tag twice).\u003C\u002Fp>\n\u003Cfigure class=\"blog-figure blog-figure--diagram\" contenteditable=\"false\">\n\u003Cdiv class=\"blog-mermaid\">\n\u003Cpre class=\"mermaid-source\">flowchart LR\n  posts[posts.id] -->|referenced by| comments[comments.post_id]\n  posts -->|referenced by| pivot[post_tag.post_id]\n  tags[tags.id] -->|referenced by| pivot2[post_tag.tag_id]\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\u003Cfigcaption>Schema shape before any Eloquent method: keys on comments and on the pivot, not on posts.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>\n\u003Cpre>\u003Ccode class=\"language-php\">Schema::create('comments', function (Blueprint $table) {\n    $table-&gt;id();\n    $table-&gt;foreignId('post_id')-&gt;constrained()-&gt;cascadeOnDelete();\n    $table-&gt;text('body');\n    $table-&gt;timestamps();\n});\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Done when \u003Ccode>php artisan migrate\u003C\u002Fcode> succeeds and \u003Ccode>comments.post_id\u003C\u002Fcode> exists. Skip this and Eloquent will still “work” — it just returns empty relations.\u003C\u002Fp>\n\n\u003Ch3 id=\"step-2\">Step 2: Define both sides of the relationship\u003C\u002Fh3>\n\u003Cp>Write the method on both models. Inverse relations are how you walk back without guessing column names later.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-php\">\u002F\u002F app\u002FModels\u002FPost.php\npublic function comments(): HasMany\n{\n    return $this-&gt;hasMany(Comment::class);\n}\n\npublic function tags(): BelongsToMany\n{\n    return $this-&gt;belongsToMany(Tag::class)-&gt;withTimestamps();\n}\n\n\u002F\u002F app\u002FModels\u002FComment.php\npublic function post(): BelongsTo\n{\n    return $this-&gt;belongsTo(Post::class);\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>If the column is not \u003Ccode>post_id\u003C\u002Fcode> — say \u003Ccode>author_id\u003C\u002Fcode> on posts — pass it: \u003Ccode>$this-&gt;belongsTo(User::class, 'author_id')\u003C\u002Fcode>. Miss that argument and you get \u003Ccode>user_id\u003C\u002Fcode> in the SQL, then a null author and a very quiet bug.\u003C\u002Fp>\n\u003Cp>Done when \u003Ccode>php artisan tinker\u003C\u002Fcode> can do \u003Ccode>Post::first()-&gt;comments\u003C\u002Fcode> and you see a collection, not an error.\u003C\u002Fp>\n\n\u003Ch3 id=\"step-3\">Step 3: Eager-load on the query you actually run\u003C\u002Fh3>\n\u003Cp>Do not load relations in a Blade loop. Put them on the query in the controller (or a query scope).\u003C\u002Fp>\n\u003Cfigure class=\"blog-figure blog-figure--diagram\" contenteditable=\"false\">\n\u003Cdiv class=\"blog-mermaid\">\n\u003Cpre class=\"mermaid-source\">flowchart TB\n  subgraph lazy [Lazy loading]\n    L1[SELECT posts] --> L2[SELECT comments WHERE post_id = 1]\n    L1 --> L3[SELECT comments WHERE post_id = 2]\n    L1 --> L4[SELECT comments WHERE post_id = N]\n  end\n  subgraph eager [Post with comments]\n    E1[SELECT posts] --> E2[SELECT comments WHERE post_id IN ids]\n  end\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\u003Cfigcaption>Same listing. Left scales with row count. Right stays at two queries.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>\n\u003Cpre>\u003Ccode class=\"language-php\">$posts = Post::query()\n    -&gt;with(['comments.author', 'tags'])\n    -&gt;withCount('comments')\n    -&gt;latest()\n    -&gt;paginate(20);\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Verify with \u003Ccode>DB::listen\u003C\u002Fcode>, Laravel Debugbar, or Telescope. You want a small, stable number of queries when you bump the page size from 10 to 50. If query count scales with row count, you still have N+1.\u003C\u002Fp>\n\n\u003Ch2 id=\"real-world-example\">Real-World Example\u003C\u002Fh2>\n\u003Cp>Stack: Laravel 11 API + a Nuxt admin listing blog posts. Goal: show title, author name, tag pills, and comment count.\u003C\u002Fp>\n\u003Cp>The first version looked fine in local with 8 posts:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-php\">$posts = Post::latest()-&gt;get();\n\nforeach ($posts as $post) {\n    $post-&gt;author-&gt;name;\n    $post-&gt;tags-&gt;pluck('name');\n    $post-&gt;comments-&gt;count();\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Telescope showed 1 + 8 + 8 + 8 queries. Production had a few hundred posts. The listing timed out. That is N+1: one query for posts, then one per relation per row.\u003C\u002Fp>\n\u003Cfigure class=\"blog-figure blog-figure--diagram\" contenteditable=\"false\">\n\u003Cdiv class=\"blog-mermaid\">\n\u003Cpre class=\"mermaid-source\">sequenceDiagram\n  participant App\n  participant DB\n  App-&gt;&gt;DB: SELECT * FROM posts\n  App-&gt;&gt;DB: SELECT * FROM users WHERE id = author_id\n  App-&gt;&gt;DB: SELECT * FROM post_tag \u002F tags\n  App-&gt;&gt;DB: SELECT * FROM comments WHERE post_id = ?\n  Note over App,DB: Repeat author, tags, comments for every post\n  App-&gt;&gt;DB: with author tags plus withCount comments\n  Note over App,DB: Query count stays flat when the page grows\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\u003Cfigcaption>Before: one extra round-trip per relation per row. After: with() plus withCount, count does not climb with page size.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>\n\u003Cp>Second bug in the same PR: \u003Ccode>Post\u003C\u002Fcode> used \u003Ccode>author_id\u003C\u002Fcode>, but \u003Ccode>belongsTo(User::class)\u003C\u002Fcode> with no second argument. SQL looked for \u003Ccode>posts.user_id\u003C\u002Fcode>. Authors were always null. The UI showed “Unknown” and we blamed the frontend.\u003C\u002Fp>\n\u003Cp>Fix:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-php\">public function author(): BelongsTo\n{\n    return $this-&gt;belongsTo(User::class, 'author_id');\n}\n\n$posts = Post::query()\n    -&gt;with(['author', 'tags'])\n    -&gt;withCount('comments')\n    -&gt;latest()\n    -&gt;paginate(20);\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Use \u003Ccode>withCount\u003C\u002Fcode> when you only need a number. Loading every comment model just to call \u003Ccode>-&gt;count()\u003C\u002Fcode> is how you blow memory on a busy post. After the change, Telescope sat at a handful of queries regardless of page size, and author names came back.\u003C\u002Fp>\n\n\u003Ch2 id=\"pros-cons\">Pros &amp; Cons\u003C\u002Fh2>\n\u003Ch3>Advantages\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>The mapping lives on the model, so controllers stay short.\u003C\u002Fli>\n\u003Cli>Eager loading and \u003Ccode>withCount\u003C\u002Fcode> \u002F \u003Ccode>whereHas\u003C\u002Fcode> cover the 90% case without raw SQL.\u003C\u002Fli>\n\u003Cli>Nested relations (\u003Ccode>comments.author\u003C\u002Fcode>) stay readable compared to multi-join select lists.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>Disadvantages\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>Lazy loading hides cost until production traffic. Nothing in the type system stops \u003Ccode>$post-&gt;comments\u003C\u002Fcode> in a loop.\u003C\u002Fli>\n\u003Cli>Name conventions fail quietly: wrong key, empty relation, no exception.\u003C\u002Fli>\n\u003Cli>Heavy reports still want Query Builder or SQL. Hydrating thousands of models to sum a column is the wrong tool.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2 id=\"best-practices\">Best Practices\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Define the inverse. You will need \u003Ccode>$comment-&gt;post\u003C\u002Fcode> the week after you ship \u003Ccode>$post-&gt;comments\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Eager-load at the query root. \u003Ccode>Post::with('tags')\u003C\u002Fcode> in the controller, not \u003Ccode>$post-&gt;load('tags')\u003C\u002Fcode> inside a loop.\u003C\u002Fli>\n\u003Cli>Prefer \u003Ccode>withCount('comments')\u003C\u002Fcode> over loading the relation when the UI only shows a number.\u003C\u002Fli>\n\u003Cli>Pass custom keys the moment the column is not \u003Ccode>{model}_id\u003C\u002Fcode>. Do not wait for null authors.\u003C\u002Fli>\n\u003Cli>Index foreign keys and pivot unique pairs. Relations do not invent indexes for you.\u003C\u002Fli>\n\u003Cli>Use \u003Ccode>whereHas\u003C\u002Fcode> \u002F \u003Ccode>whereDoesntHave\u003C\u002Fcode> to filter parents by child data instead of loading everything into PHP.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2 id=\"common-mistakes\">Common Mistakes\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>N+1 in Blade or Vue-ready JSON\u003C\u002Fstrong> — you serialized \u003Ccode>$post-&gt;comments\u003C\u002Fcode> for every item. \u003Cstrong>Fix:\u003C\u002Fstrong> \u003Ccode>with()\u003C\u002Fcode> or \u003Ccode>withCount()\u003C\u002Fcode> on the original query; confirm in Telescope.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Wrong foreign key, empty relation\u003C\u002Fstrong> — column is \u003Ccode>author_id\u003C\u002Fcode>, relation still assumes \u003Ccode>user_id\u003C\u002Fcode>. \u003Cstrong>Fix:\u003C\u002Fstrong> \u003Ccode>belongsTo(User::class, 'author_id')\u003C\u002Fcode> (and \u003Ccode>hasMany(..., 'author_id')\u003C\u002Fcode> on User).\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Calling the property, then \u003Ccode>where()\u003C\u002Fcode>\u003C\u002Fstrong> — \u003Ccode>$post-&gt;comments-&gt;where('approved', true)\u003C\u002Fcode> filters in memory after loading all comments. \u003Cstrong>Fix:\u003C\u002Fstrong> \u003Ccode>$post-&gt;comments()-&gt;where('approved', true)-&gt;get()\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>belongsToMany without a real pivot\u003C\u002Fstrong> — you stored comma-separated tag ids on \u003Ccode>posts\u003C\u002Fcode>. \u003Cstrong>Fix:\u003C\u002Fstrong> pivot table + \u003Ccode>attach\u003C\u002Fcode> \u002F \u003Ccode>sync\u003C\u002Fcode>. Comma lists will not eager-load.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Forgetting \u003Ccode>withTimestamps()\u003C\u002Fcode> on a pivot you care about\u003C\u002Fstrong> — \u003Ccode>created_at\u003C\u002Fcode> on \u003Ccode>post_tag\u003C\u002Fcode> stays null. \u003Cstrong>Fix:\u003C\u002Fstrong> chain \u003Ccode>withTimestamps()\u003C\u002Fcode> on the relation.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2 id=\"frequently-asked-questions\">Frequently Asked Questions\u003C\u002Fh2>\n\u003Ch3 id=\"faq-what-is-laravel-eloquent-relationships\">What is Laravel Eloquent Relationships?\u003C\u002Fh3>\n\u003Cp>They are model methods that tell Eloquent how two (or more) tables connect. \u003Ccode>hasMany\u003C\u002Fcode>, \u003Ccode>belongsTo\u003C\u002Fcode>, and \u003Ccode>belongsToMany\u003C\u002Fcode> are the ones you use most. After you define them, you load related models with \u003Ccode>with()\u003C\u002Fcode> instead of writing a join in every query.\u003C\u002Fp>\n\u003Ch3 id=\"faq-how-to\">How do I define Eloquent relationships in Laravel?\u003C\u002Fh3>\n\u003Cp>Add a foreign key (or pivot) in a migration, then add a typed method on the model that returns \u003Ccode>hasMany\u003C\u002Fcode>, \u003Ccode>belongsTo\u003C\u002Fcode>, or \u003Ccode>belongsToMany\u003C\u002Fcode>. Mirror the inverse on the other model. Test in tinker with \u003Ccode>Model::first()-&gt;relationName\u003C\u002Fcode> before you wire the UI.\u003C\u002Fp>\n\u003Ch3 id=\"faq-vs\">Eloquent relationships vs Query Builder joins?\u003C\u002Fh3>\n\u003Cp>Use relationships when you want related \u003Cem>models\u003C\u002Fem> and nested JSON. Use Query Builder joins when you need a flat report, aggregates across huge tables, or SQL the ORM would hydrate into thousands of objects for no reason. Same database; different shape of result.\u003C\u002Fp>\n\u003Ch3 id=\"faq-worth-it\">Are Laravel Eloquent relationships worth it?\u003C\u002Fh3>\n\u003Cp>Yes for CRUD apps, APIs, and admin panels — that is most Laravel work. Skip them on a one-off analytics query, or when you already have a tuned SQL view. The cost is not the feature; it is lazy loading you forgot to replace with \u003Ccode>with()\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3 id=\"faq-hasmany-belongstomany\">When should I use hasMany vs belongsToMany?\u003C\u002Fh3>\n\u003Cp>\u003Ccode>hasMany\u003C\u002Fcode> when the child row belongs to one parent (\u003Ccode>comments.post_id\u003C\u002Fcode>). \u003Ccode>belongsToMany\u003C\u002Fcode> when both sides can have many of the other (a post has many tags, a tag has many posts). If you are stuffing ids into a JSON column, you probably wanted a pivot.\u003C\u002Fp>\n\n\u003Ch2 id=\"summary\">Summary\u003C\u002Fh2>\n\u003Cp>Eloquent relationships are named mappings over foreign keys and pivots. You define \u003Ccode>hasMany\u003C\u002Fcode> \u002F \u003Ccode>belongsTo\u003C\u002Fcode> \u002F \u003Ccode>belongsToMany\u003C\u002Fcode> on the models, then eager-load on the query you actually run. The failure mode is not “ORM is slow.” It is one query per row, or a key name that does not match the column.\u003C\u002Fp>\n\u003Cp>Today: pick one listing in your app, turn on query logging, and add \u003Ccode>with()\u003C\u002Fcode> \u002F \u003Ccode>withCount()\u003C\u002Fcode> until the query count stops climbing with page size.\u003C\u002Fp>\n\n\u003Ch2 id=\"key-takeaways\">Key Takeaways\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Laravel Eloquent relationships describe table links as model methods, not as ad-hoc joins in every controller.\u003C\u002Fli>\n\u003Cli>Put the foreign key on the child table; use a pivot for many-to-many.\u003C\u002Fli>\n\u003Cli>Always pass custom keys when the column is not \u003Ccode>{model}_id\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>with()\u003C\u002Fcode> and \u003Ccode>withCount()\u003C\u002Fcode> are how you keep listings at a handful of queries.\u003C\u002Fli>\n\u003Cli>Call \u003Ccode>comments()\u003C\u002Fcode> when you still need to constrain the query; \u003Ccode>comments\u003C\u002Fcode> when you want the loaded collection.\u003C\u002Fli>\n\u003C\u002Ful>","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1787122982331-16979e.webp","Laravel Eloquent Relationships Explained","Learn Laravel Eloquent relationships: hasOne, hasMany, belongsToMany, eager loading, and the N+1 trap. Copy-ready examples and a real query-log fix.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fog\u002F1787122988485-sh6zwu.webp",[19,20,21,22,23],"Laravel","Eloquent","PHP","ORM","backend","published","2026-08-19T07:03:17.721+00:00",18,null,"","2026-08-19T07:03:18.062639+00:00","2026-08-20T04:19:08.829027+00:00",[],[33,48,65,81,95,109,121,133,145,157,159,170,182,195,209,220,231,240,251,265,277,286,297,310],{"id":34,"title":35,"slug":36,"excerpt":37,"cover_image":38,"tags":39,"published_at":45,"updated_at":46,"view_count":47},"1fac09f2-990e-4ebf-99b1-0cc532e7cb08","Soft Delete Inventory Bug — Phantom Serial Stock After Purchase Delete","soft-delete-inventory-bug-phantom-serial-stock-after-purchase-delete","Soft-deleting a purchase looked fine until serial-tracked products stayed sellable. The movement ran, quantity didn’t move, and serials were never detached.","https:\u002F\u002Fik.imagekit.io\u002F93se7t7h4e\u002Fportfolio\u002Fposts\u002Fblog\u002Fcovers\u002F1793165769172-Phantom-Inventory_-Deleted-Warehouse-Order_Z0BIZdhyJ.webp",[40,41,42,43,44,6],"laravel","inventory","soft-delete","serial-numbers","stock-movements","2026-10-28T05:36:31.148+00:00","2026-10-28T05:36:32.188948+00:00",21,{"id":49,"title":50,"slug":51,"excerpt":52,"cover_image":53,"tags":54,"published_at":62,"updated_at":63,"view_count":64},"b2a6b718-c6e5-42fa-9358-22e84035aaf2","Multi-Tenant Inventory Manager with Nuxt 3 and Supabase","multi-tenant-inventory-manager-nuxt-supabase","A shop-billing SaaS on Nuxt 3 and Supabase: stock, invoices, UPI links, AI bill scan, and per-shop storefronts — with RLS so shop_id is never trusted from the client.","https:\u002F\u002Fik.imagekit.io\u002F93se7t7h4e\u002Fportfolio\u002Fposts\u002Flibrary\u002F1792583563566-Modern-Retail-POS-Dashboard-Network_-BFGj_TT0.webp?updatedAt=1792583565092",[55,56,57,41,6,58,59,60,61],"nuxt","supabase","multi-tenancy","vue","pinia","vuetify","ai","2026-10-21T12:07:58.857+00:00","2026-10-21T12:07:59.070373+00:00",16,{"id":66,"title":67,"slug":68,"excerpt":69,"cover_image":70,"tags":71,"published_at":78,"updated_at":79,"view_count":80},"58f0adc6-f4e9-4501-bc0e-ab83cc2cc073","Laravel Sanctum 419 Fix — Why XSRF-TOKEN Must Stay Encrypted","laravel-sanctum-419-xsrf-token-encryption","Sanctum SPA login kept returning 419 CSRF token mismatch. The bug wasn’t domains or cookies “not sticking” — it was excluding XSRF-TOKEN from EncryptCookies while Laravel decrypts the X-XSRF-TOKEN header.","https:\u002F\u002Fik.imagekit.io\u002F93se7t7h4e\u002Fportfolio\u002Fposts\u002Fblog\u002Fcovers\u002F1792229994752-From-CSRF-Error-to-Secure-Fix_FIVIW5po2.webp",[19,72,73,74,75,76,77],"Sanctum","CSRF","419","SPA","Nuxt","API Authentication","2026-10-17T09:40:04.212+00:00","2026-10-17T09:40:06.051151+00:00",17,{"id":82,"title":83,"slug":84,"excerpt":85,"cover_image":86,"tags":87,"published_at":92,"updated_at":93,"view_count":94},"7b4bee90-b35b-4ced-ae8c-0a71e7d968fb","ImageKit Nuxt Upload — Keep Private Keys Off the Client","imagekit-nuxt-upload-secure","ImageKit Nuxt upload means the browser never sees your private key. Sign or upload on the server, return a CDN URL, and store that URL in your CMS or database.","https:\u002F\u002Fik.imagekit.io\u002F93se7t7h4e\u002Fportfolio\u002Fposts\u002Fblog\u002Fcovers\u002F1792216420019-Secure-Upload-Architecture-Flow_MGyvtL5tR.webp",[76,88,89,90,91],"ImageKit","Vue","TypeScript","SEO","2026-10-17T05:55:24.556+00:00","2026-10-17T05:55:24.735773+00:00",23,{"id":96,"title":97,"slug":98,"excerpt":99,"cover_image":100,"tags":101,"published_at":107,"updated_at":108,"view_count":64},"bd55b3c6-8bd3-447d-99ad-d46a97490d7b","Apache 2 Installation on Ubuntu: Step-by-Step","apache-2-installation-ubuntu","Install Apache 2 on Ubuntu with apt, start the service, open the firewall, and verify the default page. Part 2 of the Apache 2 series — clean setup before virtual hosts.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1788925690969-7zm2c2.webp",[102,103,104,105,106],"Apache","Ubuntu","Installation","Linux","Web Server","2026-09-09T03:49:25.809+00:00","2026-09-09T03:49:26.679843+00:00",{"id":110,"title":111,"slug":112,"excerpt":113,"cover_image":114,"tags":115,"published_at":118,"updated_at":119,"view_count":120},"8c75a723-b1a7-4fab-9bb9-71a111c9d4f8","Apache vs Nginx: What They Are and When to Use Each","apache-vs-nginx","Apache and Nginx are web servers. They take HTTP requests and return files or pass work to PHP, Node, or another app. Apache fits shared hosting and .htaccess; Nginx is the usual reverse proxy on an Ubuntu VPS.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1788524039845-wrez6s.webp",[102,116,103,106,105,117],"Nginx","DevOps","2026-09-04T12:14:08.218+00:00","2026-09-04T12:14:08.430018+00:00",9,{"id":122,"title":123,"slug":124,"excerpt":125,"cover_image":126,"tags":127,"published_at":130,"updated_at":131,"view_count":132},"40dd3304-99d2-4948-b8c1-44625f1f4306","What Is a Virtual Host? Host Multiple Sites on One Ubuntu VPS","virtual-host-linux-multiple-websites","A virtual host maps each domain to its own folder on one server. Developers use this on Ubuntu VPSes so portfolio, API, and staging share one bill. Same idea on any Linux — Ubuntu is just what most tutorials and clouds default to.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1788523755345-javhet.webp",[128,103,116,105,129,117],"Virtual Host","VPS","2026-09-04T12:09:22.623+00:00","2026-09-04T12:09:22.931401+00:00",12,{"id":134,"title":135,"slug":136,"excerpt":137,"cover_image":138,"tags":139,"published_at":142,"updated_at":143,"view_count":144},"6e45f39b-1ade-47f0-a0b0-b4cd386a10dc","Laravel Queues & Jobs: How Background Processing Works","laravel-queues-and-jobs","Laravel queues move slow work off the HTTP request. You push a Job onto a queue, a worker runs it later, and the user gets a fast response. Use them for mail, webhooks, image work, and anything that can fail and retry.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1787286979145-0i7ewp.webp",[19,140,141,21,23],"Queues","Jobs","2026-08-21T04:36:56.222+00:00","2026-08-21T04:36:56.606735+00:00",20,{"id":146,"title":147,"slug":148,"excerpt":149,"cover_image":150,"tags":151,"published_at":154,"updated_at":155,"view_count":156},"938c7bd9-2cf3-4a81-8dae-cf88c09e64ca","Laravel N+1 Query Problem: How to Detect and Fix It","laravel-n-plus-1-query-problem","The Laravel N+1 query problem is when one listing query is followed by one extra query per row. You spot it in Telescope or the query log, then fix it with with(), withCount(), and nested eager loads.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1787199419649-niq9k8.webp",[19,20,152,153,21],"N+1","performance","2026-08-20T04:17:43.609+00:00","2026-08-20T05:50:24.297698+00:00",14,{"id":9,"title":10,"slug":11,"excerpt":12,"cover_image":14,"tags":158,"published_at":25,"updated_at":30,"view_count":26},[19,20,21,22,23],{"id":160,"title":161,"slug":162,"excerpt":163,"cover_image":164,"tags":165,"published_at":168,"updated_at":169,"view_count":64},"6bbe0ad8-0c6d-4172-b279-ded8e2ca9416","Laravel Database Transactions: When and Why to Use DB::transaction()","laravel-database-transactions","DB::transaction() runs a closure inside a SQL transaction: Laravel commits if it finishes, and rolls back if it throws. Use it when one action writes more than one row and a half-finished write would leave bad data.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1787114417893-hp3hmc.webp",[19,166,20,21,167],"Database","Transactions","2026-08-19T04:44:00.327+00:00","2026-08-19T05:14:18.190197+00:00",{"id":171,"title":172,"slug":173,"excerpt":174,"cover_image":175,"tags":176,"published_at":180,"updated_at":181,"view_count":156},"d1020b7b-b410-414f-9ceb-eb0501bc905e","Laravel Auditing Package — Track Model Changes the Right Way","laravel-auditing-package","The Laravel auditing package records old and new model values, the user who changed them, and when it happened—without you inventing a second history table for every feature.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1786778101029-mwb9sf.webp",[19,177,21,178,179],"Auditing","Security","Activity Log","2026-08-15T21:24:32.135+00:00","2026-08-15T21:24:32.194447+00:00",{"id":183,"title":184,"slug":185,"excerpt":186,"cover_image":187,"tags":188,"published_at":192,"updated_at":193,"view_count":194},"3d5eb867-6288-48c4-af04-8b7ece8b874e","Laravel Lifecycle — How a Request Becomes a Response","laravel-lifecycle","The Laravel lifecycle is the path from HTTP request to response: bootstrap, service providers, middleware, routing, then the controller. Know that path and most “random” bugs stop being random.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1786777544862-khxf92.webp",[19,21,189,190,191],"Request Lifecycle","Middleware","Backend","2026-08-15T07:15:13.877+00:00","2026-08-15T07:15:13.978037+00:00",11,{"id":196,"title":197,"slug":198,"excerpt":199,"cover_image":200,"tags":201,"published_at":207,"updated_at":208,"view_count":156},"2ab5e08a-7117-43c5-87eb-0789a2fd3af4","Claude Code Best Practices for Large Codebases — Scope Before You Ship","claude-code-best-practices-large-codebases","On a big repo, Claude Code only helps if you lock rules in CLAUDE.md, scope every ticket, plan multi-file edits, and review the diff like a PR.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1786178453897-dulbmv.webp",[202,203,204,205,206],"claude-code","ai-coding","large-codebases","monorepo","developer-tools","2026-08-08T08:41:03.571+00:00","2026-08-08T08:41:03.839922+00:00",{"id":210,"title":211,"slug":212,"excerpt":213,"cover_image":214,"tags":215,"published_at":218,"updated_at":219,"view_count":26},"ddd55ce1-48fd-40b4-ae91-48a6bec20a2a","Nuxt Middleware Explained — Auth, Redirects & Route Guards Deep Dive","nuxt-middleware-explained","Nuxt middleware runs before a page loads so you can check auth, redirect users, or block a route — on the server for the first hit and in the browser on later navigations.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785902953511-osy6pt.webp",[76,190,216,217,89],"SSR","Auth","2026-08-05T04:09:38.347+00:00","2026-08-05T04:09:38.496803+00:00",{"id":221,"title":222,"slug":223,"excerpt":224,"cover_image":225,"tags":226,"published_at":229,"updated_at":230,"view_count":132},"e0d9941b-467d-45cc-bf12-45390cf9aeaa","Nuxt Lifecycle Explained — Server, Client & Hooks Made Simple","nuxt-lifecycle-explained","Nuxt lifecycle is the order your app boots, fetches data, renders HTML on the server, hydrates in the browser, then runs page navigation — so you know where to put code safely.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785901639981-9tgcl5.webp",[76,89,216,227,228],"Lifecycle","JavaScript","2026-08-05T03:54:08.301+00:00","2026-08-05T03:54:08.919676+00:00",{"id":232,"title":233,"slug":234,"excerpt":235,"cover_image":236,"tags":237,"published_at":238,"updated_at":239,"view_count":94},"23c9cf92-232b-460f-9825-a9c53e350600","How to Use Laravel Sanctum for API Authentication — SPA Cookies & Tokens","laravel-api-authentication","Laravel Sanctum authenticates first-party SPAs with secure cookies and issues API tokens for mobile or third-party clients—without the complexity of full OAuth.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785833713437-wcqb6c.webp",[19,72,77,21,75,178],"2026-08-04T08:56:17.304+00:00","2026-08-06T04:07:09.059636+00:00",{"id":241,"title":242,"slug":243,"excerpt":244,"cover_image":245,"tags":246,"published_at":249,"updated_at":250,"view_count":26},"f50b774a-c745-41aa-a3b0-72ac1f5b7117","Laravel Sanctum vs Passport — Which API Auth Should You Use?","laravel-sanctum-vs-passport","Laravel Sanctum is the lighter choice for SPAs and simple API tokens; Passport is full OAuth2 for third-party apps. Pick Sanctum for most apps, Passport when you need real OAuth2.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785817155174-054d6s.webp",[19,72,247,77,21,248,75],"Passport","OAuth2","2026-08-04T04:19:37.286+00:00","2026-08-04T04:49:08.25034+00:00",{"id":252,"title":253,"slug":254,"excerpt":255,"cover_image":256,"tags":257,"published_at":262,"updated_at":263,"view_count":264},"ef36ca16-73ab-4f9a-9584-ff70a60da5f5","Laravel vs NestJS in 2026: Which Backend Should US Startups Choose?","laravel-vs-nestjs-2026-us-startups","Laravel vs NestJS for US startups in 2026: compare speed, TypeScript, hiring, SaaS MVPs, and real-time apps — and pick the backend that matches your team.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785609396341-ungcby.jpg",[19,258,191,259,260,21,90,261],"NestJS","SaaS","Startups","Web Development","2026-08-01T18:40:05.071+00:00","2026-08-01T18:40:05.261242+00:00",38,{"id":266,"title":267,"slug":268,"excerpt":269,"cover_image":270,"tags":271,"published_at":275,"updated_at":276,"view_count":132},"c4e41758-834c-476e-8830-f776c963a784","What Is TypeScript? A Beginner’s Guide to Safer JavaScript","what-is-typescript","TypeScript is JavaScript with types. Learn what it is, how it works, and how to write your first typed script with clear examples and FAQs.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785574204088-8bc8es.jpg",[90,228,261,272,273,274],"Programming","Beginners","Frontend","2026-08-01T08:50:45.861+00:00","2026-08-01T08:50:45.958378+00:00",{"id":278,"title":279,"slug":280,"excerpt":281,"cover_image":282,"tags":283,"published_at":284,"updated_at":285,"view_count":156},"37ee32f1-7b8d-4c4d-92b4-37bb37ff64c5","What Is JavaScript? A Beginner’s Guide to Modern Web Development","what-is-javascript","JavaScript is the programming language that makes websites interactive. Learn what it is, how it works, and how to write your first script with clear examples and FAQs.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785561346515-utrr91.jpg",[228,261,272,273,274],"2026-08-01T05:16:12.728+00:00","2026-08-01T08:50:11.164531+00:00",{"id":287,"title":288,"slug":289,"excerpt":290,"cover_image":291,"tags":292,"published_at":295,"updated_at":296,"view_count":26},"f238da13-8416-41e6-8281-a6185efd4bd4","Laravel Sanctum Explained: Simple API Authentication for Modern Apps","laravel-sanctum-api-authentication","Laravel Sanctum makes API authentication simple — whether you need token-based APIs for mobile apps or cookie-based auth for SPAs. Here’s how it works, without the jargon.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785470074981-vejfi4.jpg",[19,72,293,294,75],"API","Authentication","2026-08-01T04:13:15.178+00:00","2026-08-01T08:50:11.393519+00:00",{"id":298,"title":299,"slug":300,"excerpt":301,"cover_image":302,"tags":303,"published_at":307,"updated_at":308,"view_count":309},"d8c77913-46f4-4012-ade6-bd5a81676001","Laravel Module Structure Explained: Keep Large Apps Clean","laravel-module-structure-explained","A practical guide to Laravel module architecture — folder layout, providers, routes, and boundaries that keep features independent as your app grows.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785385385865-8oyk12.png",[19,21,304,305,191,306],"Modules","Architecture","Clean Code","2026-07-30T04:54:17.431+00:00","2026-08-01T08:50:11.599795+00:00",6,{"id":311,"title":312,"slug":313,"excerpt":314,"cover_image":315,"tags":316,"published_at":323,"updated_at":324,"view_count":144},"26ccd19c-a8bb-419d-be11-efd1d221b415","Cursor vs Claude vs ChatGPT: Which AI Actually Helps with Laravel & Nuxt?","cursor-ai-vs-claude-code-vs-chatgpt-for-laravel-nuxt-development-2026","Tired of constantly copying and pasting code between your Vue frontend and PHP backend? I tested Cursor, Claude Code, and ChatGPT to see which one actually speeds up a real-world Laravel and Nuxt workflow. Here is my breakdown.","https:\u002F\u002Fkjnzswhfjfkhvplczgfs.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Fimages\u002Fblog\u002Fcovers\u002F1785300697566-pn766r.png",[19,317,318,319,320,321,322],"Nuxt 3","AI for Developers","Cursor","Claude Code","ChatGPT","Full Stack","2026-07-29T04:46:50.88+00:00","2026-08-01T08:50:11.809909+00:00",{"variant":326,"profile":331,"heroStats":344,"aboutParagraphs":348,"aboutPillars":355,"aboutFacts":368,"skillCategories":381,"experiences":420,"education":447,"projects":466,"languages":536,"interests":539},{"id":327,"slug":328,"label":329,"is_active":330,"sort_order":4},"481b2725-e0f6-43df-beea-937ec806a438","full-stack-developer","Full Stack Developer",true,{"name":332,"title":333,"tagline":333,"photo_url":334,"summary":335,"email":336,"phone":28,"location":337,"linkedin":338,"github":339,"instagram":340,"hero_headline":341,"hero_headline_accent":342,"hero_subheadline":343},"Mohd Anish","Full Stack Developer ","\u002Fprofile.png","Full Stack Developer with 3.5+ years of experience specializing in Laravel, Vue.js, Nuxt.js, MySQL, and modern web technologies. Experienced in designing, developing, and maintaining scalable web applications with a strong focus on performance, security, and code quality.","anhali736@gmail.com","Rajasthan, India","linkedin.com\u002Fin\u002Fmohd-anish-23096635a","https:\u002F\u002Fgithub.com\u002Fmrmolani76","https:\u002F\u002Fwww.instagram.com\u002Fmohdanish.me\u002F","Building Scalable Web Apps","using Modern Technologies","Building secure, scalable, and high-performance web applications using Laravel, Vue.js, Nuxt.js, and MySQL.",[345],{"value":346,"label":347},"3.5+","Yrs Development",[349,351,353],{"html":350},"I'm a \u003Cspan class=\"text-gold font-medium\">Full Stack Developer\u003C\u002Fspan> passionate about building secure, scalable, and high-performance web applications. I enjoy solving complex problems and creating modern digital experiences with clean, maintainable code.",{"html":352},"I specialize in \u003Cspan class=\"text-gold font-medium\">Laravel\u003C\u002Fspan>, \u003Cspan class=\"text-foreground\">Vue.js\u003C\u002Fspan>, \u003Cspan class=\"text-foreground\">Nuxt.js\u003C\u002Fspan>, \u003Cspan class=\"text-foreground\">MySQL\u003C\u002Fspan>, and \u003Cspan class=\"text-foreground\">REST APIs\u003C\u002Fspan>, building responsive and scalable applications with a strong focus on performance, security, and code quality.",{"html":354},"With \u003Cspan class=\"text-foreground\">3.5+ years of experience\u003C\u002Fspan>, I've contributed to enterprise-grade applications, including compliance-critical modules for the \u003Cspan class=\"text-foreground\">Complere eQMS\u003C\u002Fspan> platform. I'm committed to continuous learning and building software that is reliable, maintainable, and ready for real-world use.",[356,360,364],{"icon":357,"label":358,"description":359},"lucide:code-2","Build","Scalable, clean web apps",{"icon":361,"label":362,"description":363},"lucide:trending-up","Grow","Marketing-driven results",{"icon":365,"label":366,"description":367},"lucide:shield-check","Ship","Reliable, compliant systems",[369,373,377],{"icon":370,"label":371,"value":372},"lucide:settings","Core Stack","Laravel · Nuxt · Vue · MySQL",{"icon":374,"label":375,"value":376},"lucide:building-2","Currently","Complibued — eQMS Platform",{"icon":378,"label":379,"value":380},"lucide:map-pin","Availability","Open to opportunities",[382,395,404,415],{"title":383,"icon":384,"color":385,"show_on_home":330,"show_on_resume":330,"skills":386},"Backend Development","lucide:database","from-gold-soft to-gold-deep",[19,21,387,388,389,390,391,392,393,394],"Supabase (BaaS)","MySQL","REST APIs","Git","Docker","Redis","GitHub Actions","Cloudflare",{"title":396,"icon":397,"color":385,"show_on_home":330,"show_on_resume":398,"skills":399},"Frontend Development","lucide:code",false,[400,401,402,90,403,228],"Nuxt.js","Vue.js","React","Tailwind CSS",{"title":405,"icon":406,"color":385,"show_on_home":330,"show_on_resume":398,"skills":407},"AI & Automation","lucide:zap",[408,409,410,411,412,413,414],"Prompt Engineering","ChatGPT & Claude","Google Gemini","AI Grok","GitHub Copilot","AI Content Strategy","Workflow Automation",{"title":416,"icon":417,"color":385,"show_on_home":330,"show_on_resume":330,"skills":418},"Development","lucide:wrench",[19,21,401,400,228,90,403,389,388,419],"Git & GitHub",[421],{"role":329,"company":422,"note":423,"period":424,"description":425,"stack":426,"color":385,"icon":427,"points":428},"Complibued","Complere eQMS — Pharmaceutical SaaS","2023 – Present","Building Complere eQMS, a cloud-based Quality Management System for regulated life sciences using Laravel and Nuxt.js. Developed compliance-critical modules — Document Control, LMS, Events, CAPA, Change Control, Audit, and Risk Assessment.","Laravel · Vue\u002FNuxt · MySQL · Tailwind CSS","lucide:folder-git-2",[429,432,434,436,438,441,443,445],{"text":430,"surface":431},"Developing and maintaining a pharma-focused eQMS platform using Laravel and Nuxt.js.","resume",{"text":433,"surface":431},"Built compliance-critical modules: Document Control, Training (LMS), Event Handling, CAPA, Change Control (CR), Audit, and Risk Assessment (RA).",{"text":435,"surface":431},"Implemented approval workflows, version control, and immutable audit trails aligned to 21 CFR Part 11.",{"text":437,"surface":431},"Collaborated with QA teams to meet pharmaceutical compliance standards.",{"text":439,"surface":440},"Built Document Control & LMS (training) modules","home",{"text":442,"surface":440},"Implemented CAPA and Event management workflows",{"text":444,"surface":440},"Developed Change Control (CR) with impact-assessed approvals",{"text":446,"surface":440},"Delivered Audit & Risk Assessment (RA) modules with audit trails",[448,453,457,462],{"degree":449,"school":450,"period":451,"score":452},"M.Sc. (Computer Science)","MDS University, Ajmer","2023 – 2025","73%",{"degree":454,"school":450,"period":455,"score":456},"BCA","2020 – 2023","71%",{"degree":458,"school":459,"period":460,"score":461},"Senior Secondary (12th)","RBSE, Ajmer","2018 – 2019","68.80%",{"degree":463,"school":459,"period":464,"score":465},"Secondary (10th)","2016 – 2017","48.75%",[467,484,501],{"title":468,"slug":469,"description":470,"why":471,"category":472,"image":473,"emoji":474,"link":475,"is_active":330,"stack":476,"features":478,"metrics":483},"Inventory Manager","inventory-manager","Professional inventory management system for tracking stock, orders, and enterprise operations. Powered by Supabase auth and a relational MySQL backend.","Stock and order tracking needed a reliable source of truth for enterprise operations. This system was built so teams can monitor inventory, manage orders, and report status from one authenticated app.","Enterprise","bg-gradient-to-br from-gold-soft\u002F15 via-gold\u002F5 to-transparent","📦","https:\u002F\u002Fruby-enterprise.vercel.app\u002F",[401,477,388,403,90],"Supabase",[479,480,481,482],"Stock Tracking","Order Management","User Authentication","Reporting & Analytics",[],{"title":485,"slug":486,"description":487,"why":488,"category":489,"image":490,"emoji":491,"link":492,"is_active":330,"stack":493,"features":495,"metrics":500},"Random Video Chat","random-video-chat","Omegle-style platform for spontaneous 1-on-1 video conversations with strangers. Uses WebRTC for peer-to-peer video and Supabase Realtime for matchmaking and signaling.","I wanted to explore real-time peer connections without a heavy media server. The app was built to practice WebRTC + realtime matchmaking and deliver instant 1-on-1 video chat with no account friction.","Real-time","bg-gradient-to-br from-gold\u002F15 via-gold\u002F5 to-transparent","🎥","https:\u002F\u002Fomegle-seven-xi.vercel.app\u002F",[401,494,477,403,90],"WebRTC",[496,497,498,499],"Peer-to-Peer Video","Random Matchmaking","Realtime Signaling","No Sign-up Required",[],{"title":502,"slug":503,"description":504,"why":505,"category":506,"image":490,"emoji":507,"link":508,"is_active":330,"stack":509,"features":517,"metrics":526},"Nexro","nexro","Multi-tenant retail web app for GST billing and inventory — products, purchases, sales, POS, quotations, supplier ledgers, and reports. Landing page: nexro.me.","Retail shops were juggling billing, stock, purchases, and supplier dues across sheets and separate tools. Nexro was built as a multi-tenant SaaS so each shop gets its own data on a shared Laravel + Nuxt stack, with GST invoices, live stock, and day-to-day ops from one login.","Web App \u002F SaaS","🏪","https:\u002F\u002Fnexro.me",[510,511,512,513,403,90,388,514,515,516,391],"Laravel 12","Nuxt 4","Vue 3","Vuetify 3","stancl\u002Ftenancy","Laravel Sanctum","Spatie Permission",[518,519,520,521,522,523,524,525],"Multi-tenant shop isolation","GST billing & POS","Inventory with SKU \u002F barcode \u002F serial","Purchases & supplier ledger","Quotations → invoice","Sales, stock & dues reports","Thermal & A4 print","Region-aware landing (nexro.me)",[527,530,533],{"value":528,"label":529},"1","Product platform",{"value":531,"label":532},"7+","Core modules",{"value":534,"label":535},"MT","Multi-tenant",[537,538],"Hindi","English",[261,540,541],"Video Content","New Tools & Tech"]