Menus::byName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Chuckbe\Chuckcms\Models;
4
5
use Eloquent;
6
7
/**
8
 * @property int    $id
9
 * @property string $name
10
 */
11
class Menus extends Eloquent
12
{
13
    protected $table = 'menus';
14
15
    /**
16
     * The attributes that are mass assignable.
17
     *
18
     * @var array
19
     */
20
    protected $fillable = [
21
        'name',
22
    ];
23
24
    public function __construct(array $attributes = [])
25
    {
26
        //parent::construct( $attributes );
27
        $this->table = config('menu.table_prefix').config('menu.table_name_menus');
28
    }
29
30
    public static function byName($name)
31
    {
32
        return self::where('name', '=', $name)->first();
33
    }
34
}
35