for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use LaravelEnso\Tables\Traits\TableCache;
class Note extends Model
{
use TableCache;
// public function __construct(Array $attributes = [])
// {
// parent::__construct($attributes);
// $db = \Session::get('db');
// error_log('+++++Note++++++++++++++++++++++++++++++'.$db);
// if(empty($db)) {
// $db = env('DB_DATABASE', 'enso');
// }
// if($db === env('DB_DATABASE')) {
// $key = 'database.connections.mysql.database';
// config([$key => $db]);
// } else {
// \DB::purge('mysql');
// \DB::reconnect('mysql');
// $this->setConnection('mysql');
// error_log('-----------------------------------'.$this->getConnection()->getDatabaseName());
/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'integer';
protected $fillable = ['gid', 'note', 'rin', 'name', 'description', 'is_active', 'type_id', 'group'];
protected $attributes = ['is_active' => false];
protected $casts = ['is_active' => 'boolean'];
public function person()
return $this->belongsToMany(Person::class);
}