Beginner Problem: Class Not Found

Hi there, probably a beginner’s problem here:

I’m trying to use the beebm Illuminate Database plugin.
For installation I ran composer in my projects root. Seemed to install just fine.

My setup is Laragon/Win11 locally.

My config.php reads:

<?php

return [
    'debug' => true,
    'beebmx.db.drivers' => [
        'mysql' => [
            'driver' => 'mysql',
            'host' => 'localhost',
            'database' => 'finances',
            'username' => 'root',
            'password' => '',
            'prefix' => '',
        ],    
    ]
];

In my template it says

<?php
    use Beebmx\KirbyDB\DB;

    $count = DB::table('sets')->count() ;
    dump($count);
?>

Error message then is:
Class “Beebmx\KirbyDB\DB” not found
in line 4

Can you tell me where I went wrong?

I’m a bit older and haven’t been using all this stuff for quite a while, so I’m not really comfortable with this Class concept. Please don’t judge :slight_smile: Just trying to do a quick personal thing.

Thanks so much!

There’s a typo in the namespace, should be KirbyDb, so

use Beebmx\KirbyDb\DB;

Thank you! That did the trick!
I took the code straight from the docs, I never questioned that.

However now there’s immediately another problem with a call to an undefined function inside an SQLiteConnector, which I’m not even using. So I’ll ditch the plugin for now.

But thanks so much for the help!

The plugin docs are somehow incomplete, you also need to set

	'beebmx.db.default' => 'mysql',

or whatever database type you are using in config.php