PHP code example of xelyos94ro / database

1. Go to this page and download the library: Download xelyos94ro/database library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xelyos94ro / database example snippets


use Xelyos\Database\Facade\XelyosDatabase;

// If no parameter will be specified, will use the default value from ENV file
XelyosDatabase::checkDatabaseExist();
XelyosDatabase::checkDatabaseExist($nameOfDatabase); 
// Create database (if database exist, another database will not be created)
XelyosDatabase::createDatabase(); 
XelyosDatabase::createDatabase($nameOfDatabase); 

- PHP 7.4
- Laravel 6/7

// This will generate the database
php artisan xelyos:database:create
// And now you can use migrate
php artisan migrate