Method DatabaseFactoriesTagQuestionFactory::factory does not exist

I have a Laravel Factory named TagQuestionFactory which goes like this:

public function definition()
    {
        return [
            'tag_id' => $this->faker->numberBetween(1,50),
            'que_id' => $this->faker->numberBetween(1,50),
        ];
    }

And in DatabaseSeeder, I added this:

public function run()
    {
        TagQuestionFactory::factory(50)->create();
    }

Then I run php artisan db:seed but returns this error:

BadMethodCallException

Method DatabaseFactoriesTagQuestionFactory::factory does not exist.

So what’s going wrong here? How can I solve this issue?

How can I pass variables to the partials view in Laravel

In the ProfileController I make this method to pass a user info to user/profile.blade.php
`

class ProfileController extends Controller
{
    public function profile($username)
    {
        $user = User::where('username', $username)->first();

        return view('user.profile', compact('user'));
    }
}

`

I can successfully receive my data from the profile.blade.php file. But the problem is profile.blade.php is a component based layout. And I need to pass the user to a component [A side bar].

In profile.blade.php

<x-user.master>

<x-slot name="title">
    {{ $title ?? 'Profile | Reporter'}}
</x-slot>

<x-user.partials.sidebar />

</x-user.master>

How can I send and receive user info from the sidebar view?

Sort all new messages according to the date when message has been received by the users

I want to sort all the messages on top that has been received by the users according to the date when the message has been sent to the users

here is the code:
`

<?php
            if ($_SESSION['role_as'] === '1') {
              $query = " SELECT u.fname, u.lname, u.unique_id, shop.name as shopname FROM user u
              join tattooshops shop on shop.id=u.shopid 
              WHERE unique_id= '".$_SESSION['unique_id']."' ";
            } else {
              $query = " SELECT fname, lname, unique_id FROM user WHERE unique_id= '".$_SESSION['unique_id']."' ";
            }

            $query_run = mysqli_query($con, $query);
            $check_user = mysqli_num_rows($query_run) > 0;

            if ($check_user) {
              while ($row = mysqli_fetch_array($query_run)) {
                if ($_SESSION['role_as'] === '1') {
                  $userName = $row['shopname'];
                } else {
                  $userName = $row['fname'] ." ". $row['lname'];
                }
                echo '<div class="details">';
                  echo '<span>' . "Messages for " . $userName .'</span>';
                echo '</div>';
              }
            }
          ?>

`

this is the image that the message is not arranged accordingly:
enter image description here

I’ll expect that all the messages who are currently receiving according to date will sort on top

JS equivalent of file_get_contents in PHP?

I am trying to rewrite some code from PHP to JavaScript. To start off, I am trying to read the content from a file, but for some reason I am getting unexpected results

In PHP I have:

$raw = file_get_contents(basename("input", ".swf"));
echo strlen($raw); // 13454%

And in JS:

import { readFile } from "fs/promises";

const raw = await readFile("./input.swf", "utf8");
console.log(raw.length); // 12710

How can I get the same output in JS as in PHP?

How to decrypt an encryption used with codeigniter library from the database?

We are implementing a register and login module for our project, my teammate used the codeigniter encryption service $this->encryption->encrypt($this->input->post('passw')) for our password. The problem is with our login, we can’t seem to decrypt or read it. Little help?

Login function in controller:

> public function log_validation()
    {
        $this->form_validation->set_rules('emp_id', 'emp_id', 'required');
        $this->form_validation->set_rules('passw', 'passw', 'required');
    
        if ($this->form_validation->run() == FALSE){
            echo "<script>alert('Login Error!')</script>";
            $data['title'] = 'Login';
            $this->load->view('include/header', $data);
            $this->load->view('user/login');
        }
        else{   
            $empid = $this->input->post("emp_id");
            $password = $this->encryption->decrypt($this->input->post('passw'));
            $key = 'mykey';
            $decryptpass = $this->encryption->decrypt($password, $key);

            //function in model to get employee id and password 
            $emp_ref = $this->Users_model->verify_employee($empid, $decryptpass );

            if($emp_ref == NULL){
              echo "<script>alert('Member not found')</script>";
              redirect('Users/login_user', 'refresh');
            }elseif($emp_ref[0]->col_role == 1){
              $this->session->set_userdata("emp_id", $emp_ref[0]->col_emp_id);
              redirect('Users/dashboarda', 'refresh');
            }elseif($emp_ref[0]->col_role == 2){
              $this->session->set_userdata("emp_id", $emp_ref[0]->col_emp_id);
              redirect('Users/dashboard', 'refresh');
            }elseif($emp_ref[0]->col_role == 3){
              $this->session->set_userdata("emp_id", $emp_ref[0]->col_emp_id);
              redirect('Users/dashboard0', 'refresh');
            }
        }
    }

the model there is:

    public function verify_employee($empid, $password){
    $this->db->select('col_role, col_emp_id, col_password');
    $this->db->where('col_emp_id',  $empid);
    $this->db->where('col_password', $password);
    $query = $this->db->get($this->tbl_management_accounts);
    if($query->result() == NULL)
    {
        return NULL;
    }
    else
    {
        return $query->result();
    }
}

Trying to create new Laravel project but I get this error

It worked fine, but after I installed the cURL in my machine (Windows10), I started to deal with this issue every time I tried to create a Laravel project.

 Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework[v9.36.4, ..., 9.x-dev] require league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.8.0, ..., 3.x-dev].
    - laravel/framework[v9.19.0, ..., v9.36.3] require league/flysystem ^3.0.16 -> satisfiable by league/flysystem[3.0.16, ..., 3.x-dev].
    - league/flysystem[3.0.16, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
    - league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.12) does not satisfy that requirement.
    - league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
    - Root composer.json requires laravel/framework ^9.19 -> satisfiable by laravel/framework[v9.19.0, ..., 9.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - C:Program Filesphp-8.1.12php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.

I Tried to uncomment this command ‘extension=openssl’ in php.ini
I also executed this command ‘composer config -g — disable-tls false’ but nothing has changed .

Responsive datatable is not working while fetching data in the modal with javascript

My Javascript code is as follows

`

<script type="text/javascript">
$(document).ready(function() {
    $(document).on('click', '.modal_view_user_btn', function() {

        $('#modal_view_user').modal('show');

        $tr = $(this).closest('tr');
        var data = $tr.children("td").map(function() {

            return $(this).text();
        }).get();

        console.log(data);

        $('#vid_user_name').val(data[0]);
        $('#vid_user_email').val(data[1]);
        $('#vid_user_designation').val(data[2]);
        $('#vid_user_mobile').val(data[3]);
        $('#vid_user_landline').val(data[4]);
        $('#vid_user_role_id').val(data[5]);
        $('#vid_user_login_status').val(data[6]);
        $('#vid_user_picture').val(data[7]);
        0
    });
});
</script>

`

I used above code to fetch data in modal. placed one input as follows:

`

                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label for="vid_user_designation"
                                    class="col-sm-8 col-form-label  text-primary">Designation</label>
                                <div>
                                    <input class="form-control" type="text" name="user_designation"
                                        id="vid_user_designation" style="border-style: hidden; background-color: white;"
                                        readonly>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-6">

                            <div class="mb-3">
                                <label for="vid_user_mobile"
                                    class="col-sm-8 col-form-label  text-primary">Mobile</label>
                                <div>
                                    <input class="form-control" type="tel" name="user_mobile" id="vid_user_mobile"
                                        style="border-style: hidden; background-color: white;" readonly>

                                </div>
                            </div>
                        </div>
                    </div>

`

it workds properly When the table is shown as full screen[![enter image description here]the results are ok for instance as per below screen

(https://i.stack.imgur.com/j5me8.png)](https://i.stack.imgur.com/j5me8.png)

When i change the view to responsive style the data is not shown , infact headings of table started shown.

enter image description here

Need guidance to resolve this issue.

I am trying to fetch the data in my modal from table through a java script. When the screen for table is open as per picture it works fine, but when i change the view of table i.e to responsive view, it doesnot show information

Cannot solve Requests_Exception_Transport_cURL [ PHP & WordPress Error]

I’m getting “Undefined property: Requests_Exception_Transport_cURL::$status_code” error and failed to solve it.

    private function do_bulk_api_call( $endpoint, $data=array(), $version=0 ) {

        if( !$this->cmcapi['status'] )
            return false;

        $final_api_data = $bulk_requests = array();
        $options = get_option( 'cmcapi' );
        $version = $version ? $version : $this->cmcapi['version'];
        $bulk_url = $this->cmcapi['url'] . $version . $endpoint;

        if( $data && is_array($data) ):
        foreach ($data as $k => $chunk) {
            // TEMP condition
            // if( $k > 0 )
            //  continue;

            $bulk_requests[] = array(
                'type'      => 'GET',
                'timeout'   => 90,
                'url'       => $bulk_url,
                'headers'   => array(
                    'X-CMC_PRO_API_KEY' => $this->cmcapi['key'],
                ),
                'data'      => array( 'id' => implode(',',$chunk) )
            );
        }
        endif;
        
        $requests = Requests::request_multiple( $bulk_requests );
        foreach ($requests as $key => $response) {
            if($response->status_code !== 200) {
                continue;
            }

            $res_decoded = json_decode($response->body);
            $this->kte_shipment_api_results[$key] = array();
                $final_api_data = array_merge( (array) $final_api_data, (array) $response->data );
            
            if( !$res_decoded->status->error_code && is_object($res_decoded->data) ){
                $final_api_data = array_merge( (array) $final_api_data, (array) $res_decoded->data );
            }
        }

        return $final_api_data;
    }

By the way, this code is from other teammate and he is gone now so I cannot ask to him.

Not receing all posted data from PDF form to php

I am sending data from a PDF form with a submit button in HTML format to a php script for further processing. The form has many fields arranged in rows like this:

a group of radio buttons named: row[i][answer], then inline some text fields named: row[i][ov], row[i][plo], row[i][plcv], row[i][pls], row[i][plx] (where i is incremented from 0 to 100)

On submit i post all this data to a php script like this:

$row = $_POST['row']; 

Now the problem is that for some reason i receive all data but row[i][answer] and row[i][plx]…those 2 fields are being copmletly ignored and i cannot find a reason for this.

I did <pre><?php print_r($row); ?></pre> and there it is all the data but those 2 fields:

Array
(
    [0] => Array
        (
            [ov] => Some text.
            [plcv] => N/A
            [plo] => Art. 4 
            [pls] => N/A
        )

    [1] => Array
        (
            [ov] => Some text.
            [plcv] => N/A
            [plo] => Art. 10 
            [pls] => N/A
        )
    . . . 

There should be also [answer] and [plx] but they are compleetly missing.

I also did it with file_get_contents("php://input"); and same result, [answer] and [plx] are missing.
Any ideas why this happens?

How do debug array_multisort warning

Sometimes I find the warning “Array sizes are inconsistent” in the logs, for the command array_multisort().

This is my code:

            $columns_1 = array_column($data, 'col1');
            $columns_2 = array_column($data, 'col2');
            $columns_3 = array_column($data, 'col3');
            array_multisort($columns_1, SORT_ASC, $columns_2, SORT_ASC, $columns_3, SORT_ASC, $data);

The content of the $data-variable is fetched from an remote api.

I expect the reason for the error, is that the remote data sometimes is wrong/corrupted.

Is there any method to “catch” when there is a warning in array_multisort()?

I have tried to check for if all the arrays are of the same size and if not, not execute array_multisort, but that does not prevent the warning.

Having problems with matching the password with database in php and mysql

My connection with database is okay and I’m also getting correct data from the MySQL server. But, when I verify the password and login, then the password that input doesn’t match with the database. The problem seems to appear when I try to match the input password with the database password.

Here is my code:

<?php require 'connection.php'; ?>

<?php

//login user

if (isset($_POST['login'])) {
    
    $emailUsername = $_POST['email_username'];
    $pass = $_POST['password'];


    $sql = "SELECT * from `users` WHERE `username` = '$emailUsername' OR `email` = '$emailUsername'";
    $result = mysqli_query($conn, $sql);

    if ($result) {
        if (mysqli_num_rows($result)  == 1) {

            $fetchedResult = mysqli_fetch_assoc($result);
            
            if (password_Verify($pass, $fetchedResult['password'])){
                echo "Logged in!";
            } else {
                
                echo "Incorrect password!<br>";
                }
            }

        } else {
            echo "Incorrect username or password!";
        }
    }
}

//Register user

if (isset($_POST['register'])) {

    $name = $_POST['fullname'];
    $username = $_POST['username'];
    $email = $_POST['email'];
    $password = $_POST['password'];

   $sql = "SELECT * FROM `users` WHERE `username` = '$username' OR `email` = '$email'";
   
   $result = mysqli_query($conn, $sql);
   

   if (mysqli_num_rows($result) >0){
    $fetchedResult = mysqli_fetch_assoc($result);
    if ($fetchedResult['username'] == $username){
        echo "username already exists!";
        header("Location: index.php?error=userexists");
        exit();
    } else{
        echo "email already exists";
        header("Location: index.php?error=emailexists");
        exit();
    }
   } else {
    $pass = password_hash($password, PASSWORD_BCRYPT);
    $sql = "INSERT INTO users(`name`, `username`, `email`, `password`) VALUES ('$name', '$username', '$email', '$pass')";
    if (mysqli_query($conn, $sql)){
        echo "User registered successfully!<br>";
        echo $pass;
    } else {
        echo "Can't run query";
    }
   }

}

?>

<?php
  require 'connection.php';
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>User - Login and Register</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  
  <header>
    <h2>TJ WEBDEV</h2>
    <nav>
      <a href="#">HOME</a>
      <a href="#">BLOG</a>
      <a href="#">CONTACT</a>
      <a href="#">ABOUT</a>
    </nav>
    <div class='sign-in-up'>
      <button type='button' onclick="popup('login-popup')">LOGIN</button>
      <button type='button' onclick="popup('register-popup')">REGISTER</button>
    </div>
  </header>

  <!-- login form -->

  <div class="popup-container" id="login-popup">
    <div class="popup">
      <form method="POST">
        <h2>
          <span>USER LOGIN</span>
          <button type="reset" onclick="popup('login-popup')">X</button>
        </h2>
        <input type="text" placeholder="E-mail or Username" name="email_username">
        <input type="password" placeholder="Password" name="password">
        <button type="submit" class="login-btn" name="login">LOGIN</button>
      </form>
    </div>
  </div>

  <!-- registration form -->

  <div class="popup-container" id="register-popup">
    <div class="register popup">
      <form method="POST">
        <h2>
          <span>USER REGISTER</span>
          <button type="reset" onclick="popup('register-popup')">X</button>
        </h2>
        <input type="text" placeholder="Full Name" name="fullname">
        <input type="text" placeholder="Username" name="username">
        <input type="email" placeholder="E-mail" name="email">
        <input type="password" placeholder="Password" name="password">
        <button type="submit" class="register-btn" name="register">REGISTER</button>
      </form>
    </div>
  </div>

  <script>
    function popup(popup_name)
    {
      get_popup=document.getElementById(popup_name);
      if(get_popup.style.display=="flex")
      {
        get_popup.style.display="none";
      }
      else
      {
        get_popup.style.display="flex";
      }
    }
  </script>

</body>
</html>

I have tried the same code but I didn’t take the password from MySQL server, I typed the data manually in the code and encrypted it then it worked. The only occurs when I try to match the password with the database.

Recommended guide for Dockerized Laravel application and deploy to production server

i looking for guidelines/ course(free/ paid) to learn about how to dockerized laravel application and deploy it to a production server. Most of the resources i found in internet was covered on very simple application such as serving a fresh application in single container, and the worst things is no guides related to setup an actual server(AWS, azure or google cloud) that can support multiple docker containers.

The best i can found is teach how to deploy a single container to server which is not what i want. What i looking for is a fully working solution in multiple containers(mysql, php, nginx and etc).

I am experienced to develop and deploy web applications to production under LEMP stack or single docker container. To explore further, it would be great if i can migrate to multiple containers which is the advantages of docker.
Appreciate if someone can give me the hints on how to get started on this.

Page builder php errror

app/Http/Controllers/Admin/Extensions/PageBuilder/ManagePageBuilderController.php:138

unlink(/home/freedex/public_html/public/pages/css/https://freedex.io/faq.css): No such file or directory

hi, i am getting a php error on the admin page while creating the page.

Can you help me ?

When creating a new page in Admin, I was expecting it to create the new page directly with the page extension.

Invalid operation wen try to insert a variable in array

I try to show the counter of messages at the navbar
but i thing i do in incorrect way , i try to google about the error but can not find way to solve this error
How do i insert the $rec_count variable in correct way?

Fatal error : Constant expression contains invalid operations in
C:Program FilesAmppswwwwizjobs2022v4helpersMenu.php on line 158

<?php
/**
* Menu Items
* All Project Menu
* @category  Menu List
*/

$comp_model = new SharedController;

$rec_count = $comp_model->getcount_messages();
class Menu{


        public static $navbarsideleft = array(
    array(
        'path' => 'home', 
        'label' => 'Home', 
        'icon' => '<i class="fa fa-home "></i>'
    ),
    
    array(
        'path' => 'jobs', 
        'label' => 'Jobs', 
        'icon' => '<i class="fa fa-briefcase "></i>'
    ),
    
    array(
        'path' => 'resume', 
        'label' => 'CVs', 
        'icon' => '<i class="fa fa-file-text-o "></i>'
    ),
    
    array(
        'path' => '', 
        'label' => 'Blogs', 
        'icon' => '<i class="fa fa-bold "></i>',
'submenu' => array(
    array(
        'path' => 'blogs/Index', 
        'label' => 'Blogs', 
        'icon' => '<i class="fa fa-bold "></i>'
    ),
    
    array(
        'path' => 'blogcomments', 
        'label' => 'Blog Comments', 
        'icon' => '',
'submenu' => array(
    array(
        'path' => 'blogcomments/Index', 
        'label' => 'Blog Comments', 
        'icon' => ''
    )
)
    ),
    
    array(
        'path' => 'blogs/pending_blogs', 
        'label' => 'Pending Blogs', 
        'icon' => ''
    ),
    
    array(
        'path' => 'subdomainblogs/subblog', 
        'label' => 'Sub Domain Blogs', 
        'icon' => '<i class="fa fa-bold "></i>'
    ),
    
    array(
        'path' => 'subdomainblogs/add', 
        'label' => 'Sub Domain Blogs Add', 
        'icon' => '<i class="fa fa-plus-square-o "></i>'
    ),
    
    array(
        'path' => 'subdomainblogs/subblog_pending', 
        'label' => 'Sub Domains Blogs Pending', 
        'icon' => ''
    )
)
    ),
    
    array(
        'path' => 'categories', 
        'label' => 'Categories', 
        'icon' => '<i class="fa fa-tags "></i>'
    ),
    
    array(
        'path' => 'messages', 
        'label' => 'Messages', 
        'icon' => '<i class="fa fa-envelope "></i>'
    ),
    
    array(
        'path' => 'wiz_chain', 
        'label' => 'Wiz Chain', 
        'icon' => '<i class="fa fa-area-chart "></i>'
    ),
    
    array(
        'path' => 'sites', 
        'label' => 'Sites', 
        'icon' => '<i class="fa fa-link "></i>'
    ),
    
    array(
        'path' => 'images', 
        'label' => 'Images', 
        'icon' => '<i class="fa fa-image "></i>'
    ),
    
    array(
        'path' => 'how_to', 
        'label' => 'How To', 
        'icon' => '<i class="fa fa-book "></i>'
    ),
    
    array(
        'path' => 'users', 
        'label' => 'Users', 
        'icon' => '<i class="fa fa-users "></i>'
    ),
    
    array(
        'path' => 'guia', 
        'label' => 'Guia', 
        'icon' => ''
    ),
    
    array(
        'path' => 'tableprices', 
        'label' => 'Tableprices', 
        'icon' => ''
    )
);
    
        public static $navbartopleft = array(
    array(
        'path' => 'jobs/add', 
        'label' => 'Add New Job', 
        'icon' => '<i class="fa fa-plus-square-o "></i>'
    ),
    
    array(
        'path' => 'categories/add', 
        'label' => 'Add New Category', 
        'icon' => '<i class="fa fa-plus-square-o "></i>'
    ),
    
    array(
        'path' => 'blogs/add', 
        'label' => 'Add New Blog', 
        'icon' => '<i class="fa fa-plus-square-o "></i>'
    )
);
    
        public static $navbartopright = array(
    array(
        'path' => 'online/Index', 
        'label' => 'Online', 
        'icon' => '<i class="fa fa-globe "></i>'
    ),
    
    array(
        'path' => 'users/scores', 
        'label' => 'Top 10 users', 
        'icon' => '<i class="icon-diamond "></i>'
    ),
    
    array(
        'path' => 'workshop', 
        'label' => 'Workshop', 
        'icon' => '<i class="fa fa-shopping-basket "></i>',
'submenu' => array(
    array(
        'path' => 'workshop/Index', 
        'label' => 'Workshop', 
        'icon' => '<i class="fa fa-shopping-basket "></i>'
    ),
    
    array(
        'path' => 'workshop/pending_workshoops', 
        'label' => 'Pending Workshoops', 
        'icon' => '<i class="fa fa-shopping-basket "></i>'
    )
)
    ),
    
    array(
        'path' => '', 
        'label' => $rec_count, 
        'icon' => '<i class="fa fa-bell "></i>'
        
    )
);
    


        public static $job_type = array(
    array(
        "value" => "Aviation", 
        "label" => "Aviation", 
    ),
    array(
        "value" => "Arts", 
        "label" => "Arts", 
    ),
    array(
        "value" => "Business", 
        "label" => "Business", 
    ),
    array(
        "value" => "Agro", 
        "label" => "Agro", 
    ),
    array(
        "value" => "Forest maintenance", 
        "label" => "Forest maintenance", 
    ),
    array(
        "value" => "Garder Care", 
        "label" => "Garder Care", 
    ),
    array(
        "value" => "Painter", 
        "label" => "Painter", 
    ),
    array(
        "value" => "Plumber", 
        "label" => "Plumber", 
    ),
    array(
        "value" => "Education", 
        "label" => "Education", 
    ),
    array(
        "value" => "Law Enforcement", 
        "label" => "Law Enforcement", 
    ),
    array(
        "value" => "Media", 
        "label" => "Media", 
    ),
    array(
        "value" => "Medical", 
        "label" => "Medical", 
    ),
    array(
        "value" => "Service", 
        "label" => "Service", 
    ),
    array(
        "value" => "Technology", 
        "label" => "Technology", 
    ),
    array(
        "value" => "Social Media Manager", 
        "label" => "Social Media Manager", 
    ),
    array(
        "value" => "Online Tutor", 
        "label" => "Online Tutor", 
    ),
    array(
        "value" => "Bookkeeper", 
        "label" => "Bookkeeper", 
    ),
    array(
        "value" => "HouseSiting", 
        "label" => "HouseSiting", 
    ),
    array(
        "value" => "DogKeeper", 
        "label" => "DogKeeper", 
    ),
    array(
        "value" => "Personal Trainer", 
        "label" => "Personal Trainer", 
    ),
    array(
        "value" => "Online Beauty Advisor", 
        "label" => "Online Beauty Advisor", 
    ),
    array(
        "value" => "Online Recruiter", 
        "label" => "Online Recruiter", 
    ),
    array(
        "value" => "Email Marketer", 
        "label" => "Email Marketer", 
    ),
    array(
        "value" => "Freelance Writer", 
        "label" => "Freelance Writer", 
    ),
    array(
        "value" => "Proofreader", 
        "label" => "Proofreader", 
    ),
    array(
        "value" => "Website Designer", 
        "label" => "Website Designer", 
    ),
    array(
        "value" => "Instagram Influencer", 
        "label" => "Instagram Influencer", 
    ),
    array(
        "value" => "SEO Expert", 
        "label" => "SEO Expert", 
    ),
    array(
        "value" => "Facebook Ads Specialist", 
        "label" => "Facebook Ads Specialist", 
    ),
    array(
        "value" => "Graphic Designer", 
        "label" => "Graphic Designer", 
    ),
    array(
        "value" => "Voiceover Artist", 
        "label" => "Voiceover Artist", 
    ),
    array(
        "value" => "Stock Photographer", 
        "label" => "Stock Photographer", 
    ),
    array(
        "value" => "Data Entry Worker", 
        "label" => "Data Entry Worker", 
    ),
    array(
        "value" => "Virtual Assistant", 
        "label" => "Virtual Assistant", 
    ),
    array(
        "value" => "Customer Service Rep", 
        "label" => "Customer Service Rep", 
    ),
    array(
        "value" => "Music Reviewer", 
        "label" => "Music Reviewer", 
    ),
    array(
        "value" => "Transcriptionist", 
        "label" => "Transcriptionist", 
    ),
    array(
        "value" => "Chat Agent", 
        "label" => "Chat Agent", 
    ),
    array(
        "value" => "Website Tester", 
        "label" => "Website Tester", 
    ),
    array(
        "value" => "Online Moderator", 
        "label" => "Online Moderator", 
    ),
    array(
        "value" => "Micro Job", 
        "label" => "Micro Job", 
    ),);
    
        public static $user_type = array(
    array(
        "value" => "Administrator", 
        "label" => "Administrator", 
    ),
    array(
        "value" => "Jobseeker", 
        "label" => "Jobseeker", 
    ),
    array(
        "value" => "Employeer", 
        "label" => "Employeer", 
    ),);
    
        public static $account_status = array(
    array(
        "value" => "Active", 
        "label" => "Active", 
    ),
    array(
        "value" => "Pending", 
        "label" => "Pending", 
    ),
    array(
        "value" => "Blocked", 
        "label" => "Blocked", 
    ),);
    
        public static $Department = array(
    array(
        "value" => "Accounting and Banking", 
        "label" => "Accounting and Banking", 
    ),
    array(
        "value" => "Construction", 
        "label" => "Construction", 
    ),
    array(
        "value" => "Faishon and Style", 
        "label" => "Faishon and Style", 
    ),
    array(
        "value" => "Food and Restaurents", 
        "label" => "Food and Restaurents", 
    ),
    array(
        "value" => "Healthcare", 
        "label" => "Healthcare", 
    ),
    array(
        "value" => "Retail and Sales", 
        "label" => "Retail and Sales", 
    ),
    array(
        "value" => "Agro", 
        "label" => "Agro", 
    ),
    array(
        "value" => "Animals care", 
        "label" => "Animals care", 
    ),
    array(
        "value" => "House Siting", 
        "label" => "House Siting", 
    ),
    array(
        "value" => "Technology", 
        "label" => "Technology", 
    ),
    array(
        "value" => "Forest Care", 
        "label" => "Forest Care", 
    ),
    array(
        "value" => "Garden Care", 
        "label" => "Garden Care", 
    ),);
    
        public static $state = array(
    array(
        "value" => "active", 
        "label" => "Active", 
    ),
    array(
        "value" => "pending", 
        "label" => "Pending", 
    ),
    array(
        "value" => "block", 
        "label" => "Block", 
    ),);
    
        public static $status = array(
    array(
        "value" => "pending", 
        "label" => "Pending", 
    ),
    array(
        "value" => "active", 
        "label" => "Active", 
    ),
    array(
        "value" => "block", 
        "label" => "Block", 
    ),);
    
        public static $produtos = array(
    array(
        "value" => "job payment", 
        "label" => "Job Payment", 
    ),
    array(
        "value" => "workshop payment", 
        "label" => "Workshop Payment", 
    ),
    array(
        "value" => "blogs payment", 
        "label" => "Blogs Payment", 
    ),);
    
        public static $metodo = array(
    array(
        "value" => "bank transfer", 
        "label" => "Bank Transfer", 
    ),
    array(
        "value" => "pay pal", 
        "label" => "Pay Pal", 
    ),);
    
        public static $statusdopagamento = array(
    array(
        "value" => "pending", 
        "label" => "Pending", 
    ),
    array(
        "value" => "payd", 
        "label" => "Payd", 
    ),);
    
}

PHP content disposition file name error safari

I have a database from which I would like the user to download data
I’m trying to download mp3 files. If the file contains, for example, Cyrillic characters, then in Safari I get the file ÐÐ¸Ð·Ð½ÐµÑ lite – ÐÑÐ°Ñ talk.mp3, in other browsers I get a normal file name Бизнес lite – Краш talk.mp3. Here is a sample code. Help, please, what am I doing wrong?

`
$src_file = ROOT_PATH . '/files/uploads/' . substr( $track_file['name'], 0, 2) . '/' . $track_file['name'];
if(file_exists($src_file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="'. $track_file['title'] . '.mp3"');
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . filesize($src_file));
    ob_clean();
    flush();
    readfile($src_file);
    exit;
`