Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/likesistemas/eloquent-external
Usando o Eloquent sem nenhuma dependecia com o Laravel Framework.
https://github.com/likesistemas/eloquent-external
eloquent eloquent-orm laravel-framework
Last synced: about 2 months ago
JSON representation
Usando o Eloquent sem nenhuma dependecia com o Laravel Framework.
- Host: GitHub
- URL: https://github.com/likesistemas/eloquent-external
- Owner: likesistemas
- License: gpl-3.0
- Created: 2022-03-24T18:47:56.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-03T16:46:42.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T12:44:41.161Z (4 months ago)
- Topics: eloquent, eloquent-orm, laravel-framework
- Language: PHP
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Eloquent] Using Eloquent without any dependency on Laravel Framework [![CI](https://github.com/likesistemas/eloquent-external/actions/workflows/ci.yml/badge.svg)](https://github.com/likesistemas/eloquent-external/actions/workflows/ci.yml)
## Installation
```
composer require likesistemas/eloquent-external
```## How to use
### Using class `ConfigBean`
```php
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();```