dev-master
9999999-devVendor for oracle at laravel
MIT
The Requires
- php ^7.1
- illuminate/support ^5.5
by Daniil Krents
laravel php oracle phporacle
Wallogit.com
2017 © Pedro Peláez
Vendor for oracle at laravel
Vendor for oracle at laravel, (*1)
Add to app.php at 'providers' block:, (*2)
\OracleLib\Providers\OracleServiceProvider::class
Next:, (*3)
php artisan vendor:publish --provider="\OracleLib\Providers\OracleServiceProvider" --tag="config"
Create trait, like at example:, (*4)
trait OracleRepositoryList
{
}
Next all new repository add at this trait and AppServiceProvider, (*5)
/**
* @return FooRepository
*/
public function fooRepository()
{
return app(FooRepository::class);
}
At AppServiceProvider, (*6)
public function boot()
{
$this->app->singleton(FooRepository::class, function () {
return new FooRepository(app('oracle'));
});
}
At class, where you wanna use this repo add trait and use it like this:, (*7)
class FooClass
{
use OracleRepositoryList;
public function method()
{
$this->testRepository()->test()
}
}
Example call function with cursor:, (*8)
$result = $this->execute(
[
'function' => 'devdb.get_stat',
'return_type' => 'cursor',
],
[
'p_id_user' => 1,
]);
$stats = array_keys_rename($result['cursor'], [
'EXPERIENCE' => 'experience',
'STATUS' => 'status',
'DT => 'date',
]);
$stats = array_keys_set_type($stats, [
'experience' => 'integer',
'status' => 'integer',
'credit_date' => 'date',
]);
Vendor for oracle at laravel
MIT
laravel php oracle phporacle