php - Unable to choose specific database connection in Laravel -


i have defined second sqlite connection in database.php:

'connections' => [          'sqlite' => [             'driver' => 'sqlite',             'database' => env('db_database', database_path('database.sqlite')),             'prefix' => '',         ],          'hamilton' => [             'driver' => 'sqlite',             'database' => env('db_database', database_path('hamilton.sqlite')),             'prefix' => '',         ], 

unfortunately, when try use this:

public function beyondmapservice($datasetname) {          switch ($datasetname) {             case 'population':                  $conn = db::conection('hamilton');                 return $conn->select('select * stats;'); 

i exception on db::connection line, saying

call_user_func_array() expects parameter 1 valid callback, class 'illuminate\database\sqliteconnection' not have method 'conection'

why , how use multiple databases?

update

my shame!

you spelt connection wrong, spelt conection


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -