corcel / corcel

Use WordPress backend with Laravel or any PHP application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InvalidArgumentException with message 'Database connection [corcel] not configured.'

mpapado3 opened this issue · comments

  • Corcel Version: 5.0.0
  • Framework Name & Version: Laravel 8
  • PHP Version: 8
  • Database Driver & Version: Mysql

Description:

I have made a fresh laravel installation and installed corcel.
Published the config and added the wordpress database details on the database config file. But when I try to get all the posts from the wordpress database using Tinker I get error:
"InvalidArgumentException with message 'Database connection [corcel] not configured.'"

I have already cleared cache and config with php artisan command.

database.php
'wordpress' => [ // for WordPress database (used by Corcel) 'driver' => 'mysql', 'host' => env('WP_HOST', '127.0.0.1'), 'database' => env('WP_DATABASE', 'forge'), 'username' => env('WP_USERNAME', 'forge'), 'password' => env('WP_PASSWORD', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => env('WP_PREFIX', ''), 'strict' => false, 'engine' => null, ],

corcel.php
'connection' => 'wordpress',