One Hat Cyber Team
Your IP :
3.133.142.101
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
/
Edit File:
TicketFile.php
<?php namespace App\Models; use App\Traits\IconTrait; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** * App\Models\TicketFile * * @property int $id * @property int $user_id * @property int $ticket_reply_id * @property string $filename * @property string|null $description * @property string|null $google_url * @property string|null $hashname * @property string|null $size * @property string|null $dropbox_link * @property string|null $external_link * @property string|null $external_link_name * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read mixed $file_url * @property-read mixed $icon * @property-read \App\Models\TicketReply $reply * @method static \Illuminate\Database\Eloquent\Builder|TicketFile newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|TicketFile newQuery() * @method static \Illuminate\Database\Eloquent\Builder|TicketFile query() * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereDescription($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereDropboxLink($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereExternalLink($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereExternalLinkName($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereFilename($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereGoogleUrl($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereHashname($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereSize($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereTicketReplyId($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|TicketFile whereUserId($value) * @property-read mixed $file * @mixin \Eloquent */ class TicketFile extends BaseModel { use IconTrait; const FILE_PATH = 'ticket-files'; protected $appends = ['file_url', 'icon', 'file']; public function getFileUrlAttribute() { if($this->external_link){ return str($this->external_link)->contains('http') ? $this->external_link : asset_url_local_s3($this->external_link); } return asset_url_local_s3(TicketFile::FILE_PATH . '/' . $this->ticket_reply_id . '/' . $this->hashname); } public function getFileAttribute() { return $this->external_link ?: (TicketFile::FILE_PATH . '/' . $this->ticket_reply_id . '/' . $this->hashname); } public function reply(): BelongsTo { return $this->belongsTo(TicketReply::class); } }
Simpan