One Hat Cyber Team
Your IP :
3.146.107.168
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:
TaskFile.php
<?php namespace App\Models; use App\Traits\IconTrait; /** * App\Models\TaskFile * * @property int $id * @property int $user_id * @property int $task_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 int|null $added_by * @property int|null $last_updated_by * @property-read mixed $file_url * @property-read mixed $icon * @method static \Illuminate\Database\Eloquent\Builder|TaskFile newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|TaskFile newQuery() * @method static \Illuminate\Database\Eloquent\Builder|TaskFile query() * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereAddedBy($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereDescription($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereDropboxLink($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereExternalLink($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereExternalLinkName($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereFilename($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereGoogleUrl($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereHashname($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereLastUpdatedBy($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereSize($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereTaskId($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|TaskFile whereUserId($value) * @property-read mixed $file * @mixin \Eloquent */ class TaskFile extends BaseModel { use IconTrait; const FILE_PATH = 'task-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(TaskFile::FILE_PATH . '/' . $this->task_id . '/' . $this->hashname); } public function getFileAttribute() { return $this->external_link ?: (TaskFile::FILE_PATH . '/' . $this->task_id . '/' . $this->hashname); } }
Simpan