|
@@ -18,19 +18,22 @@ class Role extends Model
|
|
|
protected $fillable = ['name', 'slug'];
|
|
|
|
|
|
/**
|
|
|
- * Create a new Eloquent model instance.
|
|
|
- *
|
|
|
- * @param array $attributes
|
|
|
+ * {@inheritDoc}
|
|
|
*/
|
|
|
public function __construct(array $attributes = [])
|
|
|
+ {
|
|
|
+ $this->init();
|
|
|
+
|
|
|
+ parent::__construct($attributes);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function init()
|
|
|
{
|
|
|
$connection = config('admin.database.connection') ?: config('database.default');
|
|
|
|
|
|
$this->setConnection($connection);
|
|
|
|
|
|
$this->setTable(config('admin.database.roles_table'));
|
|
|
-
|
|
|
- parent::__construct($attributes);
|
|
|
}
|
|
|
|
|
|
/**
|