Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
TemplateSubcategoryLv2 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
templates | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
subcategory_lv1 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Http\Models; |
4 | |
5 | use Illuminate\Database\Eloquent\Relations\BelongsTo; |
6 | use Illuminate\Database\Eloquent\Relations\HasMany; |
7 | |
8 | class TemplateSubcategoryLv2 extends Moloquent |
9 | { |
10 | protected $table = 'template_subcategory_lv2'; |
11 | |
12 | protected $fillable = [ |
13 | 'parent_sub_category_id', 'name', 'slug', |
14 | ]; |
15 | |
16 | public function templates(): HasMany |
17 | { |
18 | return $this->hasMany(Template::class, 'subcategory_lv2_id'); |
19 | } |
20 | |
21 | public function subcategory_lv1(): BelongsTo |
22 | { |
23 | return $this->belongsTo(TemplateSubCategoryLv1::class, 'parent_sub_category_id'); |
24 | } |
25 | } |