Nothing is provided, but you can make your own team that could do this for you:
php artisan make:console CreateDatabase // Note, in 5.3 this is make:command
Then in app/Console/Commands you will find CreateDatabase.php . Open this suction cup and make a few changes:
protected $name = "make:database";
Then below in your file we need a new function:
protected function getArguments() { return [ ['name', InputArgument::REQUIRED, 'The name of the database'], ]; }
Then we will create another function called fire() , which will be called when the command is called:
public function fire() { DB::getConnection()->statement('CREATE DATABASE :schema', ['schema' => $this->argument('name')]); }
And now you can just do this:
php artisan make:database newdb
Now you will receive the newdb database created for you based on the configuration of your connection.
Edit I forgot the most important part - you need to tell app\Console\Commands\Kernel.php about your new command, be sure to add it to the protected $commands[] array.
protected $commands = [
source share