How to create new empty database with Laravel over Model

前端 未结 5 1567
清酒与你
清酒与你 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:16

    You can run artisan commands from code.

    Artisan::call('migrate');
    

    To run composer commands (you'll need it to register migrations), use php shell_exec:

    shell_exec('composer dumpauto');
    

提交回复
热议问题