F1.11 Php Laravel(Lumen) how to use command:crtdb and command:dropdb commands (Wpf, Xamarin, Angular SPA, Reactjs SPA) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

Two connections required:

  • Open config/database.php and add two new connections:
    • One of the connections will be used as a helper connection to open connection to the SQL server.
      • sys_mysql plays the role of the helper connection
    • The second connection is for the name of the database to be created/droped
      • litdbcontext defines the name of the database to create or drop
  • save config/database.php
  • everything is ready to run commands

picture

Create database sample:

  • run cmd
    • run cd c:\dev\LumLit (or cd c:\dev\LarLit)
    • run php artisan command:crtdb

picture

Here is a result

picture

Drop database sample:

  • run cmd
    • run cd c:\dev\LumLit (or cd c:\dev\LarLit)
    • run php artisan command:dropdb

picture