One Hat Cyber Team
Your IP :
3.143.203.21
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
centos12
/
public_html
/
centosuit
/
app
/
Models
/
View File Name :
Issue.php
<?php namespace App\Models; use App\Traits\HasCompany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Notifications\Notifiable; /** * App\Models\Issue * * @property int $id * @property string $description * @property int|null $user_id * @property int|null $project_id * @property string $status * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read mixed $icon * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications * @property-read int|null $notifications_count * @property-read \App\Models\Project|null $project * @method static \Illuminate\Database\Eloquent\Builder|Issue newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Issue newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Issue query() * @method static \Illuminate\Database\Eloquent\Builder|Issue whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereDescription($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereProjectId($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Issue whereUserId($value) * @property int|null $company_id * @property-read \App\Models\Company|null $company * @method static \Illuminate\Database\Eloquent\Builder|Issue whereCompanyId($value) * @mixin \Eloquent */ class Issue extends BaseModel { use Notifiable, HasCompany; public function project(): BelongsTo { return $this->belongsTo(Project::class, 'project_id'); } /** * @param int $projectId * @param null $userID * @return Issue[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection */ public static function projectIssuesPending($projectId, $userID = null) { $projectIssue = Issue::where('project_id', $projectId); if ($userID) { $projectIssue = $projectIssue->where('user_id', '=', $userID); } $projectIssue = $projectIssue->where('status', 'pending') ->get(); return $projectIssue; } public function checkIssueClient(): bool { $issue = Issue::where('id', $this->id) ->where('user_id', user()->id) ->count(); if ($issue > 0) { return true; } return false; } }