One Hat Cyber Team
Your IP :
172.70.50.38
Server IP :
188.114.96.7
Server :
Linux advantage-project 5.14.0-503.26.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 19 16:28:19 UTC 2025 x86_64
Server Software :
Apache/2.4.62 (Rocky Linux) OpenSSL/3.2.2
PHP Version :
8.3.17
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
html
/
app
/
Models
/
Edit File:
Image.php
<?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Image extends Model { use HasFactory; protected $guarded = ['id']; public function clean() { $orphanImages = $this->whereNull('content_id') ->whereNotNull('key') ->whereDate('created_at', '<' ,Carbon::parse('-1 day')->format('Y-m-d'))->get(); foreach ( $orphanImages as $image) { if( $image->image && file_exists(public_path('/'). $image->image)) { unlink(public_path('/').$image->image); } $image->delete(); } return count($orphanImages); } }
Simpan