laravel/framework — pull request #6102 by alidrus (2014-10-15 11:38:51+00:00)
Title: Added "json" type column to Schema Builder.

Please consider adding these changes to master branch. The "json" type column is native to PostgreSQL >= 9.2 but there is no reason why we can't have them in the Schema Builder. Other grammars easily implement the column using a "text" type. I've added the column definitions for all existing grammars. IMO these should also be back ported to 4.2.

The *only* caveat is that the column type does not exist for PostgreSQL versions 9.1 and earlier. I was browsing through some of the code and found that there's isn't any mechanism for version detection (or is there?). It would be useful to have something like this in the PostgresGrammar.php:

if ($pgVersion < 9.2)
{
return "text";
}
else
{
return "json";
}