Completed
Push — develop ( 0bdcf1...3b506c )
by Enea
09:31 queued 08:05
created

Grantable::getConfigTableName()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
ccs 0
cts 0
cp 0
nc 1
1
<?php
2
/**
3
 * Created on 11/02/18 by enea dhack.
4
 */
5
6
namespace Enea\Authorization\Models;
7
8
use Illuminate\Database\Eloquent\Model;
9
10
abstract class Grantable extends Model
11
{
12 52
    public function __construct(array $attributes = [])
13
    {
14 52
        $this->setTable($this->getConfigTableName());
15 52
        parent::__construct($attributes);
16 52
    }
17
18
    abstract protected function getConfigTableName(): string;
19
20
    public function __toString()
21
    {
22
        return $this->getAttribute('secret_name');
23
    }
24
}
25