| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace App\Models;
- use App\Enums\SupportRequestStatusEnum;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * @property int $id
- * @property int|null $user_id
- * @property string|null $user_type
- * @property string|null $name
- * @property string|null $email
- * @property string|null $phone
- * @property string $category
- * @property string $title
- * @property string $message
- * @property SupportRequestStatusEnum $status
- * @property int|null $handled_by
- * @property \Illuminate\Support\Carbon|null $resolved_at
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @property \Illuminate\Support\Carbon|null $deleted_at
- * @property-read \App\Models\User|null $user
- * @property-read \App\Models\User|null $handler
- */
- class SupportRequest extends Model
- {
- use HasFactory, SoftDeletes;
- protected $table = 'support_requests';
- protected $guarded = [
- 'id',
- ];
- protected $fillable = [
- 'user_id',
- 'user_type',
- 'name',
- 'email',
- 'phone',
- 'category',
- 'title',
- 'message',
- 'status',
- 'handled_by',
- 'resolved_at',
- ];
- protected $casts = [
- 'status' => SupportRequestStatusEnum::class,
- 'resolved_at' => 'datetime',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'deleted_at' => 'datetime',
- ];
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class, 'user_id');
- }
- public function handler(): BelongsTo
- {
- return $this->belongsTo(User::class, 'handled_by');
- }
- }
|