How to create new empty database with Laravel over Model

前端 未结 5 1561
清酒与你
清酒与你 2021-01-25 20:55

is there any way to create new database with Laravel CodeBehind ? I mean, I\'m not able to use php artisan or something like that. Just because I want

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 21:11

    well, you could perform a database query for each bd and than use the mysql or you sgbd database create command, for eg;

      DB::getConnection()->statement('CREATE DATABASE :schema', array('schema' => "dasdsdasdsadsadsa"))
    

    It probably will work with what you want.

提交回复
热议问题