forked from hectorbenitez/curso-introduccion-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.php
36 lines (27 loc) · 979 Bytes
/
console.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';
use Illuminate\Database\Capsule\Manager as Capsule;
$dotenv = new Dotenv\Dotenv(__DIR__ );
$dotenv->load();
$capsule = new Capsule;
$capsule->addConnection([
'driver' => getenv('DB_DRIVER'),
'host' => getenv('DB_HOST'),
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASS'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'port' => getenv('DB_PORT')
]);
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
use Symfony\Component\Console\Application;
$application = new Application();
$application->add(new \App\Commands\CreateUserCommand());
$application->add(new \App\Commands\SendMailsCommand());
$application->run();