MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/.trash/app/Models/ClientChargeCode.php
<?php

/**
 * ClientChargeCodeModel class file
 *
 * PHP Version 7.2
 *
 * @category Model
 * @package  Ez
 * @author   Imenso Software <admin@imensosoftware.com>
 * @license  http://imensosoftware/license.php GNU Public License
 * @link     http://imensosoftware.com/recipes
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * ClientChargeCodeModel class
 *
 * The class manage ClientChargeCode related queries
 *
 * @category ClientChargeCodeModel
 * @package  Ez
 * @author   Imenso Software <admin@imensosoftware.com>
 * @license  http://imensosoftware/license.php GNU Public License
 * @link     http://imensosoftware.com/recipes
 */
  
class ClientChargeCode extends Model
{
    public $table = "client_charge_codes";
    public $fillable = ['client_charge_code'];
    public $timestamps = false;

    /**
     * GetClientChargeCode function make a client charge code and
     * return the client charge code.
     *
     * @param  int chars
     * @param  int size
     * @param  array client charge codes
     * @return client charge code array
     */
    /*public static function getClientChargeCode($chars, $size, $combinations = array())
    {
        // if it's the first iteration, the first set
        // of combinations is the same as the set of characters
        if (empty($combinations)) {
            $combinations = $chars;
        }
        // we're done if we're at size 1
        if ($size == 1) {
            return $combinations;
        }
        // initialise array to put new values in
        $new_combinations = array();
        // loop through existing combinations and character set to create strings
        foreach ($combinations as $combination) {
            foreach ($chars as $char) {
                if ($combination != $char) {
                    $new_combinations[] = [$combination,$char] ;
                }
            }
        }
        // call same function again for the next iteration
        return self::getClientChargeCode($chars, $size - 1, $new_combinations);
    }*/
}