One Hat Cyber Team
Your IP :
216.73.216.55
Server IP :
5.189.175.239
Server :
Linux panel.gemx-ai.com 5.14.0-570.19.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 4 04:00:24 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
farmersapp
/
hrm.farmersapp.store
/
app
/
Models
/
View File Name :
AccountList.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class AccountList extends Model { protected $fillable = [ 'company_id', 'account_name', 'initial_balance', 'account_number', 'branch_code', 'bank_branch', 'created_by', ]; public static function add_Balance($id, $amount) { $accountBalance = \App\Models\AccountList::where('id', '=', $id)->first(); $accountBalance->initial_balance = $amount + $accountBalance->initial_balance; $accountBalance->save(); } public static function remove_Balance($id, $amount) { $accountBalance = \App\Models\AccountList::where('id', '=', $id)->first(); $accountBalance->initial_balance = $accountBalance->initial_balance - $amount; $accountBalance->save(); } public static function transfer_Balance($from_account,$to_account,$amount) { $fromAccount = \App\Models\AccountList::where('id', '=', $from_account)->first(); $fromAccount->initial_balance = $fromAccount->initial_balance - $amount; $fromAccount->save(); $toAccount = \App\Models\AccountList::where('id', '=', $to_account)->first(); $toAccount->initial_balance = $toAccount->initial_balance + $amount; $toAccount->save(); } }