1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 09:04:04 +00:00

Change default tenant model, write more tests, cleanup

This commit is contained in:
Samuel Štancl 2020-05-13 06:23:41 +02:00
parent c32f229dd5
commit de53b81c0e
33 changed files with 210 additions and 90 deletions

View file

@ -2,7 +2,7 @@
namespace Stancl\Tenancy\Database\Concerns;
trait HasADataColumn
trait HasDataColumn
{
public static $priorityListeners = [];
@ -13,9 +13,9 @@ trait HasADataColumn
*
* @var string
*/
public $dataEncodingStatus = 'decoded'; // todo write tests for this
public $dataEncodingStatus = 'decoded';
public static function bootHasADataColumn()
public static function bootHasDataColumn()
{
$encode = function (self $model) {
if ($model->dataEncodingStatus === 'encoded') {

View file

@ -0,0 +1,16 @@
<?php
namespace Stancl\Tenancy\Database\Concerns;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\DatabaseConfig;
trait HasDatabase
{
public function database(): DatabaseConfig
{
/** @var TenantWithDatabase $this */
return new DatabaseConfig($this);
}
}