One Hat Cyber Team
Your IP :
3.147.103.244
Server IP :
104.21.96.1
Server :
Linux agrigation-prod 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64
Server Software :
nginx/1.24.0
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
forge
/
gftag.com
/
app
/
Models
/
Edit File:
Review.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Review extends Model { protected $fillable = ['user_id','item_id','review','rating','status','subject']; public function user() { return $this->belongsTo('App\Models\User')->withDefault(); } public function item() { return $this->belongsTo('App\Models\Item')->withDefault(); } public static function ratings($item_id){ $stars = Review::whereStatus(1)->whereItemId($item_id)->avg('rating'); $ratings = number_format((float)$stars, 1, '.', '') * 20; return $ratings; } }
Simpan