Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 2 |
| WebsitePhoto | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 2 |
| category | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| descriptions | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\BelongsTo; | |
| use Illuminate\Database\Eloquent\Relations\HasMany; | |
| class WebsitePhoto extends Model | |
| { | |
| // Disable timestamp | |
| public $timestamps = false; | |
| protected $fillable = ['image', 'url', 'website_category_id']; | |
| /** | |
| * Return website gallery for photo | |
| * @return BelongsTo | |
| */ | |
| public function category() : BelongsTo | |
| { | |
| return $this->belongsTo(WebsiteCategory::class); | |
| } | |
| /** | |
| * Return descriptions for image | |
| * @return HasMany | |
| */ | |
| public function descriptions() :HasMany | |
| { | |
| return $this->hasMany(WebsitePhotoDescriptions::class); | |
| } | |
| } |