⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.37
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
vhosts
/
raqmix.net
/
testpos.raqmix.net
/
app
/
Edit File: Unit.php
<?php namespace App; use DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Unit extends Model { use SoftDeletes; /** * The attributes that should be mutated to dates. * * @var array */ /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = ['id']; /** * Return list of units for a business * * @param int $business_id * @param bool $show_none = true * @return array */ public static function forDropdown($business_id, $show_none = false, $only_base = true) { $query = Unit::where('business_id', $business_id); if ($only_base) { $query->whereNull('base_unit_id'); } $units = $query->select(DB::raw('CONCAT(actual_name, " (", short_name, ")") as name'), 'id')->get(); $dropdown = $units->pluck('name', 'id'); if ($show_none) { $dropdown->prepend(__('messages.please_select'), ''); } return $dropdown; } public function sub_units() { return $this->hasMany(\App\Unit::class, 'base_unit_id'); } public function base_unit() { return $this->belongsTo(\App\Unit::class, 'base_unit_id'); } }
Simpan