⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.91
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
wesellcomputer.com_new_old
/
app
/
View File Name :
Category.php
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Category extends Model { protected $appends = ['category_name', 'image_path']; public function group() { return $this->belongsTo('App\Group'); } public function modifiedBy() { return $this->belongsTo('App\User','modified_by'); } public function parentCategory() { return $this->belongsTo('App\Category','parent_id'); } public function products() { return $this->belongsToMany('App\Product','product_categories','category_id','product_id'); } public function childCategories() { return $this->hasMany('App\Category','parent_id'); } public function getCategoryNameAttribute() { if(empty($this->parentCategory)) return ""; else return $this->parentCategory->name; } public function getImagePathAttribute() { if(empty($this->image) || $this->image == "") return asset('/categories/default.jpg'); else return asset('/categories').'/'.$this->image; } }