public static function initialize()
 {
     self::$capsule = new Capsule();
     self::$capsule->addConnection(['driver' => Config::get('db.driver'), 'host' => Config::get('db.host'), 'database' => Config::get('db.name'), 'username' => Config::get('db.username'), 'password' => Config::get('db.password'), 'charset' => Config::get('db.charset'), 'collation' => Config::get('db.collation'), 'prefix' => Config::get('db.prefix')]);
     self::$capsule->setEventDispatcher(new Dispatcher(new Container()));
     self::$capsule->setAsGlobal();
     self::$capsule->bootEloquent();
 }
 public static function initialize()
 {
     self::$mailer = new PHPMailer();
     if (Config::get('mail.smtp')) {
         self::$mailer->isSMTP();
     }
     self::$mailer->Host = Config::get('mail.host');
     self::$mailer->SMTPAuth = Config::get('mail.smtp');
     self::$mailer->Username = Config::get('mail.username');
     self::$mailer->Password = Config::get('mail.password');
     self::$mailer->SMTPSecure = Config::get('mail.secure');
     self::$mailer->Port = Config::get('mail.port');
     self::$mailer->isHTML(Config::get('mail.html'));
 }
Beispiel #3
0
 public static function password($password)
 {
     return password_hash($password, (int) Config::get('hash.algo'), ['cost' => (int) Config::get('hash.cost')]);
 }