Marketplace package catalogue

* Modules, themes, and extensions
* Publisher profiles and verification metadata
* Installed-package tracking
* Semantic version compatibility checks
* PHP, Laravel, and Content Manager compatibility checks
* Dependency resolution
* SHA-256 checksum validation
* Package signature requirements
* Installation and update history
* Enable and disable controls
* Removal handling
* Rollback records
* Licence records
* Marketplace administration UI
* Authenticated REST endpoints
* Console audit and synchronisation commands
* Permissions and sidebar integration
* Feature tests
This commit is contained in:
Mark Gregory
2026-07-24 13:49:14 +01:00
parent 673554d92d
commit f09a680531
29 changed files with 617 additions and 11 deletions
@@ -0,0 +1,9 @@
<?php
namespace Modules\Marketplace\Models;
use Illuminate\Database\Eloquent\Model;
final class Installation extends Model
{
protected $table='marketplace_installations';
protected $fillable=['installed_package_id','package_name','operation','from_version','to_version','status','snapshot_path','message','context','performed_by','started_at','completed_at'];
protected $casts=['context'=>'array','started_at'=>'datetime','completed_at'=>'datetime'];
}
@@ -0,0 +1,14 @@
<?php
namespace Modules\Marketplace\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class InstalledPackage extends Model
{
protected $table='marketplace_installed_packages';
protected $fillable=['marketplace_package_id','package_name','type','version','status','manifest','checksum','install_path','is_enabled','installed_by','installed_at','updated_at_marketplace'];
protected $casts=['manifest'=>'array','is_enabled'=>'boolean','installed_at'=>'datetime','updated_at_marketplace'=>'datetime'];
public function package(): BelongsTo { return $this->belongsTo(MarketplacePackage::class,'marketplace_package_id'); }
public function installations(): HasMany { return $this->hasMany(Installation::class,'installed_package_id'); }
public function hasUpdate(): bool { return $this->package?->latest_version && version_compare($this->package->latest_version,$this->version,'>'); }
}
@@ -0,0 +1,10 @@
<?php
namespace Modules\Marketplace\Models;
use Illuminate\Database\Eloquent\Model;
final class MarketplaceLicence extends Model
{
protected $table='marketplace_licences';
protected $fillable=['marketplace_package_id','licence_key','status','plan','licensed_to','activated_at','expires_at','metadata'];
protected $hidden=['licence_key'];
protected $casts=['activated_at'=>'datetime','expires_at'=>'datetime','metadata'=>'array'];
}
@@ -0,0 +1,13 @@
<?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'); }
}
+11
View File
@@ -0,0 +1,11 @@
<?php
namespace Modules\Marketplace\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class Publisher extends Model
{
protected $table='marketplace_publishers';
protected $fillable=['name','slug','email','website','public_key','is_verified','metadata'];
protected $casts=['is_verified'=>'boolean','metadata'=>'array'];
public function packages(): HasMany { return $this->hasMany(MarketplacePackage::class,'publisher_id'); }
}