diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 3e8eeab99b4..0082873701b 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -291,6 +291,28 @@ public function create() return $this->addCommand('create'); } + /** + * Specify the charset that should be used for the table. + * + * @param string $charset + * @return void + */ + public function charset($charset) + { + $this->charset = $charset; + } + + /** + * Specify the collation that should be used for the table. + * + * @param string $collation + * @return void + */ + public function collation($collation) + { + $this->collation = $collation; + } + /** * Specify the storage engine that should be used for the table. * diff --git a/tests/Database/DatabaseMySqlSchemaGrammarTest.php b/tests/Database/DatabaseMySqlSchemaGrammarTest.php index cf0b3fa010a..bbe69fb2d46 100755 --- a/tests/Database/DatabaseMySqlSchemaGrammarTest.php +++ b/tests/Database/DatabaseMySqlSchemaGrammarTest.php @@ -131,8 +131,8 @@ public function testCharsetCollationCreateTable() $blueprint->create(); $blueprint->increments('id'); $blueprint->string('email'); - $blueprint->charset = 'utf8mb4'; - $blueprint->collation = 'utf8mb4_unicode_ci'; + $blueprint->charset('utf8mb4'); + $blueprint->collation('utf8mb4_unicode_ci'); $conn = $this->getConnection(); $conn->shouldReceive('getConfig')->once()->with('engine')->andReturn(null);