laravel/framework — pull request #5837 by bishopb (2014-09-26 03:09:51+00:00)
Title: Query grammar should not explode segments on alias

While trying to wrangle `DB::table()->insert()` into supporting this crazy schema (not mine, attempting a legacy interface):
```
mysql> create table test (`foo.bar` int);
Query OK, 0 rows affected (0.05 sec)

mysql> describe test;
+---------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| foo.bar | int(11) | YES | | NULL | |
+---------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)
```
I noticed that `Illuminate\Database\Grammar::wrap()` explodes the alias into segments, which doesn't seem right: the alias must always be treated as a constant value, devoid of any special meaning with reserved characters.

This PR simply makes `select x.y as foo.bar` become logically wrapped to `select "x"."y" as "foo.bar"`, instead of `foo.bar` being treated as a table and column reference (which isn't possible).