27 lines
927 B
PHP
27 lines
927 B
PHP
<?php
|
|
|
|
namespace Modules\Marketplace\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
final class MarketplacePackage extends Model
|
|
{
|
|
protected $table = 'marketplace_packages';
|
|
|
|
protected $fillable = ['publisher_id', 'type', 'name', 'slug', 'package_name', 'description', 'latest_version', 'homepage', 'repository_url', 'download_url', 'checksum', 'signature', 'manifest', 'is_featured', 'is_active', 'catalogue_updated_at'];
|
|
|
|
protected $casts = ['manifest' => 'array', 'is_featured' => 'boolean', 'is_active' => 'boolean', 'catalogue_updated_at' => 'datetime'];
|
|
|
|
public function publisher(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Publisher::class);
|
|
}
|
|
|
|
public function licences(): HasMany
|
|
{
|
|
return $this->hasMany(MarketplaceLicence::class, 'marketplace_package_id');
|
|
}
|
|
}
|