How to connect laravel with oracle



How to connect laravel with oracle

Before starting please
If u are using wamp server
Then go to your green icon of wamp
Then php
Then php extensions
And tick php_oci8_11g(if u are using oracle 11 g)
If u are using xamp server
Then go to your php.ini file
Check that your line extension=php_oci8_12c.dll ; is uncomment

Here I am using xamp server..

Steps

Step1:
write following in terminal
[if you are using Laravel 5.3,then following line ]
composer require yajra/laravel-oci8:”5.3.*”
[if you are using Laravel 5.2,then following line]
composer require yajra/laravel-oci8:”5.2.*”
[if you are using Laravel 5.1,then following line]

composer require yajra/laravel-oci8:”5.1.*“
(here I am using laravel 5.3)
Step2:
add following to the providers section of config/app.php.
                YajraOci8Oci8ServiceProvider::class
Step3:

Write php artisan vendor:publish –tag=oracle in terminal

step4
then go to .env file and set up database like
DB_CONNECTION=oracle
DB_HOST=localhost
DB_PORT=your_oracle_port_no
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

DB_PORT info is located in orantNET80ADMIN TNSNAMES.ORA

source

Reply


Build A Site Info