42 lines
876 B
PHP
42 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Models\Fox;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class FoxLearningEvent extends Model
|
|
{
|
|
use HasUuids;
|
|
|
|
protected $table = 'fox_learning_events';
|
|
|
|
const STATUS_PENDING = 'pending';
|
|
const STATUS_APPROVED = 'approved';
|
|
const STATUS_REJECTED = 'rejected';
|
|
|
|
protected $fillable = [
|
|
'input',
|
|
'extracted_memory',
|
|
'status',
|
|
'approved_at',
|
|
'rejected_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'extracted_memory' => 'array',
|
|
'approved_at' => 'datetime',
|
|
'rejected_at' => 'datetime',
|
|
];
|
|
|
|
public function scopePending($query)
|
|
{
|
|
return $query->where('status', self::STATUS_PENDING);
|
|
}
|
|
|
|
public function isPending(): bool
|
|
{
|
|
return $this->status === self::STATUS_PENDING;
|
|
}
|
|
}
|