uawdijnntqw1x1x1
IP : 216.73.216.130
Hostname : it-staging-server
Kernel : Linux it-staging-server 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
forge
/
stage.sksb.smartcon-survey.com
/
app
/
Console
/
..
/
Models
/
Comment.php
/
/
<?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Comment extends Model { use HasFactory; protected $guarded = []; public function interview(): BelongsTo { return $this->belongsTo(Interview::class); } public function assignedTopics(): BelongsToMany { return $this->belongsToMany(Topic::class, 'comments_topics', 'comment_id', 'topic_id'); } public function topic(): BelongsTo { return $this->belongsTo(Topic::class); } public static function showComment(int $id): void { static::where('id', $id)->update(['show' => 1]); } public static function hideComment(int $id): void { static::where('id', $id)->update(['show' => 2]); } public static function restoreComment(int $id): void { static::where('id', $id)->update(['show' => 0]); } public static function updateComment(int $id, string $comment): void { static::where('id', $id)->update(['comment' => $comment]); } public function scopeWhereInDateRange(Builder $query, array $dateRange): void { $filter = ''; foreach ($dateRange as $key => $month) { [$month, $year] = explode('-', $month); $date = Carbon::create($year, $month); $monthStart = $date->startOfMonth()->format('Y-m-d'); $monthEnd = $date->endOfMonth()->format('Y-m-d'); $filter .= "(comments.created_at >= '$monthStart' AND comments.created_at <= '$monthEnd')"; if ($key < count($dateRange) - 1) { $filter .= ' OR '; } } $query->whereRaw("($filter)"); } }
/home/forge/stage.sksb.smartcon-survey.com/app/Console/../Models/Comment.php