One Hat Cyber Team
Your IP :
52.15.122.33
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 :
ProjectTemplateMember.php
<?php namespace App\Models; use App\Scopes\ActiveScope; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Notifications\Notifiable; /** * App\Models\ProjectTemplateMember * * @property int $id * @property int $user_id * @property int $project_template_id * @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\ProjectTemplate $projectTemplate * @property-read \App\Models\User $user * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember newQuery() * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember query() * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember whereProjectTemplateId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTemplateMember whereUserId($value) * @mixin \Eloquent */ class ProjectTemplateMember extends BaseModel { use Notifiable; protected $with = ['user']; public function routeNotificationForMail() { return $this->user->email; } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id')->withoutGlobalScope(ActiveScope::class); } public function projectTemplate(): BelongsTo { return $this->belongsTo(ProjectTemplate::class); } public static function byProject($id) { return ProjectTemplateMember::join('users', 'users.id', '=', 'project_template_members.user_id') ->where('project_template_members.project_id', $id) ->where('users.status', 'active') ->get(); } public static function checkIsMember($projectId, $userId) { return ProjectTemplateMember::where('project_template_id', $projectId) ->where('user_id', $userId)->first(); } }