Joined October 2014
·
Posted to
Custom datatype in Laravel schema builder
over 1 year
ago
The only issue i have found with this method thus far is that for some reason when creating tables using this method, the created tables do not honor any prefix set (in config) for the database connection, why this is i do not know.
A workaround is to fetch the prefix and then manually prepend it while creating your tables eg:
$prefix = DB::connection()->getTablePrefix();
$schema->create($prefix.'yourtable',function(ExtendedBlueprint $table) {
...
});
Having looked into this a little more i found an enlightening post regarding this subject here: http://forumsarchive.laravel.io/viewtopic.php?pid=34937 if you follow the method outlined in that post then you no longer need to worry about things like database prefix.