PHP code example of likesistemas / eloquent-external
1. Go to this page and download the library: Download likesistemas/eloquent-external 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/ */
likesistemas / eloquent-external example snippets
use Illuminate\Container\Container;
use Like\Database\Config;
use Like\Database\ConfigBean;
use Like\Database\Eloquent;
$config = new ConfigBean(
'host',
'user',
'password',
'db_name'
);
$config->setFactoryFolder(__DIR__ . "/./factories/"); # Folder where all the Eloquent factories are.
$config->addFakerProvider(ProdutoProvider::class); # Optional. Use to add new providers to Faker. Note: you can add as many as you like.
# If you are configuring the settings in the same file that will start, you can pass the config by parameter.
Eloquent::init($config);
# Or set using `illuminate\container` and run init without parameter.
Container::getInstance()->instance(Config::class, $config);
# Then call `init` wherever you think is best, without having to pass parameters.
Eloquent::init();