⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.94
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hrms.dev-unit.com
/
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(); } }