Reputation: 7115
I want create database in laravel with migration.
I know that how to create table in laravel 5.1
but How to create database?
Upvotes: 0
Views: 1013
Reputation: 15673
Impossible using Laravel classes and without already having a database setup, as you have to provide the database name and credentials in config.
Laravel database classes only operate at the database level, not the database server level. You have to create your database on your database server.
If you are using some cloud based database (like AWS) there are probably CLI commands that those vendors provide to create a database. You could theoretically call the CLI commands from Laravel, or even better use some build tool like Grunt or Gulp.
Or you can use native PHP to create a database.
Upvotes: 2