for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace jeremykenedy\LaravelRoles\Database;
use Illuminate\Database\Eloquent\Model;
abstract class Database extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table;
* The connection name for the model.
protected $connection;
* Create a new instance to set the table and connection.
* @return void
public function __construct($attributes = [])
parent::__construct($attributes);
if ($connection = config('roles.connection')) {
$this->connection = $connection;
}
* Get the database connection.
public function getConnectionName()
return $this->connection;
* Get the database table.
public function getTableName()
return $this->table;