38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\BazaarReleaseFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable(['mobile_app_id', 'bazaar_release_id', 'status', 'artifact_type', 'staged_rollout_percentage', 'auto_publish', 'changelog_fa', 'changelog_en', 'developer_note', 'bazaar_response', 'committed_at', 'published_at'])]
|
|
class BazaarRelease extends Model
|
|
{
|
|
/** @use HasFactory<BazaarReleaseFactory> */
|
|
use HasFactory;
|
|
|
|
protected $attributes = [
|
|
'status' => 'draft',
|
|
'staged_rollout_percentage' => 100,
|
|
'auto_publish' => false,
|
|
];
|
|
|
|
public function mobileApp(): BelongsTo
|
|
{
|
|
return $this->belongsTo(MobileApp::class);
|
|
}
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'auto_publish' => 'boolean',
|
|
'bazaar_response' => 'array',
|
|
'committed_at' => 'datetime',
|
|
'published_at' => 'datetime',
|
|
];
|
|
}
|
|
}
|