Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
66.67% |
2 / 3 |
| VideoCategory | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2.15 | |
66.67% |
2 / 3 |
| descriptions | |
0.00% |
0 / 1 |
2.15 | |
66.67% |
2 / 3 |
|||
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\HasMany; | |
| use Illuminate\Database\Eloquent\SoftDeletes; | |
| class VideoCategory extends Model | |
| { | |
| // use soft delete | |
| use SoftDeletes; | |
| protected $fillable = ['image']; | |
| /** | |
| * Get the description of the video category. | |
| * @param int $language_id | |
| * @return HasMany | |
| */ | |
| public function descriptions($language_id = 0) : HasMany | |
| { | |
| if ($language_id) { | |
| return $this->hasMany(VideoCategoryDescription::class)->where('language_id', $language_id); | |
| } | |
| return $this->hasMany(VideoCategoryDescription::class); | |
| } | |
| } |