---
title: "Discussion on \"Eloquent Trick: Laravel Model from Subquery\" | Hashnode"
description: "Discussion on \"Eloquent Trick: Laravel Model from Subquery\". In Laravel, it's common to define a model's corresponding table using the table property, such as:\nclass User extends Model {\n  protected $table = 'users';\n}\n\nThis approach maps the model directly to a database table. However, there are situations wh..."
url: "https://hashnode.com/posts/eloquent-trick-laravel-model-from-subquery/66f60b4895c0e1e5ebbbd86a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Eloquent Trick: Laravel Model from Subquery](https://blog.jobins.jp/eloquent-trick-laravel-model-from-subquery?utm_source=hashnode&utm_medium=feed)

In Laravel, it's common to define a model's corresponding table using the table property, such as: class User extends Model { protected $table = 'users'; } This approach maps the model directly to a database table. However, there are situations wh...

Aug 1, 2024 · 3 min read · blog.jobins.jp  
Read the article

-   [#laravel](https://hashnode.com/tag/laravel)
-   [#eloquent](https://hashnode.com/tag/eloquent)
-   [#subqueries](https://hashnode.com/tag/subqueries)

## Written by

[Bedram Tamang](https://hashnode.com/@Bedram)

@Bedram

  
[View profile](https://hashnode.com/@Bedram)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
