Skip to content

Instantly share code, notes, and snippets.

@nickstewart95

nickstewart95/Loader.php

Last active Jun 8, 2020
Embed
What would you like to do?
<?php
namespace Sample;
use \Illuminate\Database\Capsule\Manager as Capsule;
class Loader {
public function init() {
$this->initEloquent();
$this->initActions();
$this->initFilters();
}
protected function initEloquent() {
$params = [
'driver' => 'mysql',
'database' => '',
'username' => '',
'password' => '',
'host' => '',
'prefix' => 'wp_',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
];
$capsule = new Capsule();
$capsule->addConnection($params, 'default');
$capsule->setAsGlobal();
$capsule->bootEloquent();
}
protected function initActions() {
}
protected function initFilters() {
}
public function activatePlugin() {
}
public function deactivatePlugin() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.