34 lines
1021 B
PHP
34 lines
1021 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\BazaarReviewFactory;
|
|
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_review_id', 'user_account_id', 'rate', 'text', 'app_version_code', 'is_edited', 'published_at', 'developer_reply_text', 'developer_reply_email', 'developer_replied_at', 'bazaar_response'])]
|
|
class BazaarReview extends Model
|
|
{
|
|
/** @use HasFactory<BazaarReviewFactory> */
|
|
use HasFactory;
|
|
|
|
protected $attributes = ['is_edited' => false];
|
|
|
|
public function mobileApp(): BelongsTo
|
|
{
|
|
return $this->belongsTo(MobileApp::class);
|
|
}
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_edited' => 'boolean',
|
|
'published_at' => 'datetime',
|
|
'developer_replied_at' => 'datetime',
|
|
'bazaar_response' => 'array',
|
|
];
|
|
}
|
|
}
|