So, I started learning laravel few days ago and now I have problem with eloquent ORM.

I have 2 tables:

```

Links:
╔════╦═══════╗
║ Id ║ Name  ║
╠════╬═══════╣
║ 1  ║ test  ║
║ 2  ║ test2 ║
╚════╩═══════╝

Likes:
╔════╦═════════╦═══════╦══════════════════╗
║ Id ║ link_id ║ total ║ created_at       ║
╠════╬═════════╬═══════╬══════════════════╣
║ 1  ║ 1       ║ 5     ║ 2014.08.27 11:32 ║
║ 2  ║ 2       ║ 10    ║ 2014.08.29 07:07 ║
╚════╩═════════╩═══════╩══════════════════╝

```

Each day I create new row in `likes` table and then increasing column `total` for each new like. The reason why I doing this, because I need to filter by how many likes has each link today, this week and this month. So, I don't know how to do this in Eloquent ORM. With eager loading looks like it's impossible, because there is 2 different queries, I need something similar to JOINS to use both tables in 1 query.

My current query:

```
$links = Link::with('likes')->paginate(10);

```

Any ideas, how I can do it?

Sorry for my english. Thanks.

**EDIT**

Query in SQL should look similar to:

> 
> SELECT \* FROM links AS ln LEFT JOIN likes AS lk ON ln.id =
>  lk.link\_id WHERE lk.created\_at BETWEEN '2014-08-28 09:52:58' and
>  '2014-08-29 09:52:58' ORDER BY lk.total
> 
> 
>