This integration allows the use of odbc_* php function with Laravel framework instead of PDO.
It emulates PDO class used by Laravel.
This is a fork of the project abram/laravel-odbc, but customized for informix.
composer require mkrohn/laravel-odbc-informix
To add source in your project
It's very simple to configure:
1) Add database to database.php file
'odbc-connection-name' => [
'driver' => 'odbc',
'dsn' => 'OdbcConnectionName',
'database' => 'DatabaseName',
'odbc' => true,
'host' => '127.0.0.1',
'username' => 'username',
'password' => 'password'
'options' => [
'processor' => Mkrohn\Odbc\Informix\Query\Processors\InformixProcessor::class,
'grammar' => [
'query' => Mkrohn\Odbc\Informix\Query\Grammars\InformixGrammar::class,
'schema' => Mkrohn\Odbc\Informix\Schema\Grammars\InformixGrammar::class
]
]
]
You can use Laravel, Eloquent ORM and other Illuminate's components as usual.
# Facade
$books = DB::connection('odbc-connection-name')->table('books')->where...;
# ORM
$books = Book::where...->get();