creating a record inside database doesn't work for mariadb because database manager driver for mariadb is not registered.
Stancl\Tenancy\Exceptions\DatabaseManagerNotRegisteredException
Steps to reproduce
start fresh laravel project:
set db connection to mariadb in .env:
DB_CONNECTION=mariadb
install stancl/tenancy normally
create custom tenant model
`namespace App\Models;
use Stancl\Tenancy\Database\Models\Tenant as BaseTenant;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Concerns\HasDatabase;
use Stancl\Tenancy\Database\Concerns\HasDomains;
use Stancl\Tenancy\DatabaseConfig;
use Illuminate\Database\Eloquent\Model;
use Truck;
use Driver;
use Staff;
use Warehouse;
class Company extends BaseTenant implements TenantWithDatabase
{
//
public function database() : DatabaseConfig
{
return new DatabaseConfig($this);
}
public function drivers() {
return $this->hasMany(Driver::class);
}
public function staff() {
return $this->hasMany(Staff::class);
}
public function warehouses() {
return $this->hasMany(Warehouse::class);
}
public function trucks(){
return $this->hasMany(Truck::class);
}
}`
use tinker tool to instantiate an object of the custom tenant model
$company1 = App\Models\Company::create(['id' => 0, 'name' => 'my_company', 'special_code' => 'foode']);
Expected behavior
An Object of The Custom Tenant model is successfully instantiated and inserted into database.
Bug description
creating a record inside database doesn't work for mariadb because database manager driver for mariadb is not registered.
Stancl\Tenancy\Exceptions\DatabaseManagerNotRegisteredException
Steps to reproduce
DB_CONNECTION=mariadb
use Stancl\Tenancy\Database\Models\Tenant as BaseTenant; use Stancl\Tenancy\Contracts\TenantWithDatabase; use Stancl\Tenancy\Database\Concerns\HasDatabase; use Stancl\Tenancy\Database\Concerns\HasDomains; use Stancl\Tenancy\DatabaseConfig; use Illuminate\Database\Eloquent\Model;
use Truck; use Driver; use Staff; use Warehouse;
class Company extends BaseTenant implements TenantWithDatabase { //
}`
$company1 = App\Models\Company::create(['id' => 0, 'name' => 'my_company', 'special_code' => 'foode']);
Expected behavior
An Object of The Custom Tenant model is successfully instantiated and inserted into database.
Laravel version
11.28.0
stancl/tenancy version
3.8