laravel/laravel — pull request #977 by racklin (2012-07-19 03:03:11+00:00)
Title: Added support UUIDs as primary key

*Added support UUIDs as primary key and generated uuid automatically when new record created.*

Because Eloquent not decribe table's column types from database, so add two variables to indicates you want to using UUID as primary key or automatically generate UUID or using database default.

```php
class Test extends Eloquent {
public static $table = 'tests';
public static $key_is_uuid = true;
public static $key_generate_uuid = true; // auto generate UUID in eloquent.
}
```

*Schema support DB::raw express in migration*
```php
Schema::create('test', function($table)
{
$table->uuid('id')->default(DB::raw('uuid_generate_v4()'));
$table->uuid('uuid')->default('i am static string default');
$table->string('name');
$table->timestamps();
});

```