likesistemas / eloquent-external
Using eloquent without linking with laravel framework.
Installs: 10 656
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.40
- fakerphp/faker: ^1.9
- illuminate/database: ^5.4 || ^7.0
- illuminate/events: ^5.4 || ^7.0
- psr/container: =1.0.0
- symfony/finder: ^3.4 || ^5.0
Requires (Dev)
- likesistemas/eloquent-ide-helper: ^1.0
- limedeck/phpunit-detailed-printer: ^2.0 || ^6.0
- phpunit/phpunit: ^5.0 || ^9.0
- yoast/phpunit-polyfills: ^2.0
README
Installation
composer require likesistemas/eloquent-external
How to use
Using class ConfigBean
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();