Want to load google pay api after the livewire componet is rendered [closed]

I am facing issue in my code in which the components are loaded dynamically like based on certain condition a component is loaded and if i place this

<script src={{asset('paymentapi/googlePay.js')}}></script>
<script async src="https://pay.google.com/gp/p/js/pay.js" onload="console.log('TODO: add onload function')"></script>

it doesn’t load it.
i want something like first the component loads after that the scripts runs.

Symfony 7 – proper way to reuse parts of common forms with many entities

I need a help with check if my thinking is correct.

My application allows to publish adverts on website. I have have many entites with similar fields. For example consider this approach:

I have 3 entities:

  • Customer (contains: id, name, description)
  • Advertisement (contains: id, name, description, address1, address2, city)
  • DeliveryAddress: (contains: id, address1, adddress2, city)

I have two traits (to avoid declare the same entity properties many times):
BaseTrait: name, description
AddressTrait: address1, address2, city

And I have 2 custom form fields:

  • address (contains: address1, address2, city)
  • baseInfo (contains: name, description)

My goal is use fields address, and baseInfo to combine it in one field and attach constraints from entity to fields, included in these custom fields, for example:

class Advertisement {
    // My entity
    #[AssertNotBlank]
    private string $name;

    #[AssertNotBlank]
    private string $description;

    #[AssertNotBlank]
    private string $address1;

    #[AssertNotBlank]
    private string $address2;

    #[AssertNotBlank]
    private string $city;

//Form 
$builder->add('baseInfo', BaseType::class, [ // Map properties from this field to Advertisement properties: name, description
$builder->add('address', AddressType::class, [ // Map properties from this field to Customer properties: address1, address2, city

So after submit form, I should have errors for fields name, description, address1, address2, city when will be empty (because Entity defines constraints NotBlank).

I would like do the same (reuse some of my custom fields) with other entities, like:

class Customer {
    // My entity
    #[AssertNotBlank]
    private string $name;

    #[AssertNotBlank]
    private string $description;

    #[AssertNotBlank]
    private string $anotherProperty;
//Form 
$builder->add('baseInfo', BaseType::class, [ // Map properties from this field to Customer properties: name, description
$builder->add('anotherProperty', TextType::class

Similar, fields name, description should have constraints from Entity

I tried many things from ChatGPT or Symfony docs, but no luck. When I try to add custom field, I cannot set mapping=>true, because property address/baseInfo doesn’t exist inside entity (its logical). When I put mapping=>false, then validation is skiped.

I tried to combine validation groups, but not luck as well. Seems that Symfony docs doesn’t say anything how to nest Entity fields into custom form type with custom fields (with constraints).

I didn’t share my code here, becasue I’m wondering if my thinking is correct. Maybe I could resolve it by parent Abstract class or make full form based on something Interface etc. But it means, that for (for example 50 entities), I will have to create 50 similar or unique forms, what it’s unecessary effort for me.

So in sum, will be grateful for ideas how to proper resolve this issue
and don’t repeat too much code.

Will be grateful for all your hints.

Buf with protoc_builtin PHP has different behaviour than the actual protoc plugin?

I’m migrating a PHP project using protoc to the Buf CLI. To ensure backwards compatibility, I’m trying to have Buf produce more or less exactly the same output as the builtin PHP plugin would do.
I’ve configured my buf.gen.yaml to use protoc_builtin: php as the target plugin and left out any opts, as protoc also wasn’t taking any arguments before.

When I run buf generate, but the GPBMetadata binary files are now in the wrong directory. protoc puts them in a directory at the top level of your output replicating your directory structure (not even your package path, just the directories).

Here’s my directory structure:

src
| users
    | user.proto
| items
    | user_item.proto

Running this using Buf (which is claiming to use the protoc-builtin php plugin) produces this output:

buf_out
| Users
    | User.php
    | Metadata
        | User.php
| Items
    | UserItem.proto
        | Metadata
            | UserItem.php

However, running this with protoc on my machine, it yields:

builtin-out
| Metadata
    | Users
        | User.php
    | Items
        | User_item.proto
| Users
    | User.php
| Items
    | User_item.proto

Notice also the differences in Snakecase conversion. Clearly Buf is doing more than it’s documentation is telling us.

Are there any flags to Buf that let me revert to the protoc behaviour. Or am I on the wrong version somehow? (using 1.45.0 btw)

Why cannot the routing engines of PHP handle the /.pages?

So, I was working on [routing] mechanisms. I was trying to set up dynamic pages for my site. Something like this /@{username} pages.

I was trying what the server can handle, and then I came across the conditions that is not being handled properly. What i tried was: localhost:8080/hello

This route was not set to any controller so, this returned a 404 page.
But when I tried /.hey I was shown the forbidden page. I tried /.htaccess then other page names random ones /.kishor and found that none of these pages are being handled as also not being captured by the index.php file.

Any way to capture these requests as well and then manage by the routing mechanisms? I tried this on my website and the same occurs if the file exists.

Tried, wordpress.com/.htaccess and that page is not managed either, also the same on laravel.com.htaccess. Any methods to solve this? Any method to handle these links as well by the index.php in the page?

Table filtered by in laravel

Im using this code to try to filter per day, month and year, It is a simple app to register and manage attendance in Laravel, when trying to apply the filters, they simply do not apply, please help with this.

This is my code: @extends(‘layouts.app’)

@section(‘title’, ‘Listado de Asistencias’)

@section(‘content’)

Listado de Asistencias

@if(session('success'))
    <p class="success-message">{{ session('success') }}</p>
@endif

<form action="{{ route('asistencias.index') }}" method="GET"> 
    <div class="form-row"> 
        <div class="form-group col-md-3">
            <label for="filtro">Filtrar por:</label>
            <select name="filtro" class="form-control" onchange="this.form.submit()"> 
                <option value="">Selecciona un filtro</option>
                <option value="semana" {{ request('filtro') == 'semana' ? 'selected' : '' }}>Esta Semana</option>
                <option value="mes" {{ request('filtro') == 'mes' ? 'selected' : '' }}>Este Mes</option>
                <option value="anio" {{ request('filtro') == 'anio' ? 'selected' : '' }}>Este Año</option>
            </select>
        </div>
        <div class="form-group col-md-3">
            <label for="fecha_inicio">Fecha de inicio:</label>
            <input type="date" class="form-control" name="fecha_inicio" value="{{ request('fecha_inicio') }}">
        </div>
        <div class="form-group col-md-3">
            <label for="fecha_fin">Fecha de fin:</label>
            <input type="date" class="form-control" name="fecha_fin" value="{{ request('fecha_fin') }}">
        </div>
        <div class="form-group col-md-3">
            <label for="per_page">Filas por página:</label>
            <select name="per_page" class="form-control" onchange="this.form.submit()">
                <option value="5" {{ request('per_page') == 5 ? 'selected' : '' }}>5</option>
                <option value="20" {{ request('per_page') == 20 ? 'selected' : '' }}>20</option>
                <option value="50" {{ request('per_page') == 50 ? 'selected' : '' }}>50</option>
                <option value="100" {{ request('per_page') == 100 ? 'selected' : '' }}>100</option>
            </select>
        </div>
    </div>
    <button type="submit" class="btn btn-primary">Filtrar por Fecha</button> 
</form>


<table class="asistencias-table">
    <thead>
        <tr>
            <th>Nombre</th>
            <th>Edad</th>
            <th>Sexo</th>
            <th>Sector</th>
            <th>Actividad</th>
            <th>Fecha</th>
        </tr>
    </thead>
    <tbody>
        @foreach($asistencias as $asistencia)
            <tr>
                <td>{{ $asistencia->nombre }} {{ $asistencia->apellido }}</td>
                <td>{{ $asistencia->edad }}</td>
                <td>{{ $asistencia->sexo }}</td>
                <td>{{ $asistencia->sector }}</td>
                <td>{{ $asistencia->actividad->nombre_actividad }}</td>
                <td>{{ $asistencia->fecha_asistencia->format('d/m/Y') }}</td>
            </tr>
        @endforeach
    </tbody>
</table>

<nav class="actions">
    <button id="btn-reg-asis" ><a href="{{ route('asistencias.create') }}" >
        Nueva asistencia<a></button>

        <button id="btn-ver-stats"><a href="{{ route('asistencias.estadisticas') }}">
            Ver estadísticas de las asistencias<a></button>
</nav>

<div class="pagination-links">
    <nav aria-label="Page navigation example"> 
        <ul class="pagination">
            <li class="page-item {{ $asistencias->previousPageUrl() ? '' : 'disabled' }}">
                <a class="page-link" href="{{ $asistencias->previousPageUrl() }}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            @for ($i = 1; $i <= $asistencias->lastPage(); $i++)
                <li class="page-item {{ ($asistencias->currentPage() == $i) ? 'active' : '' }}">
                    <a class="page-link" href="{{ $asistencias->url($i) }}">{{ $i }}</a>
                </li>
            @endfor
            <li class="page-item {{ $asistencias->nextPageUrl() ? '' : 'disabled' }}">
                <a class="page-link" href="{{ $asistencias->nextPageUrl() }}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</div>

@endsection

is in the code 😀 im new in this

PDO_ODBC not returing same data as odbc_* functions

I’m not able to return same data with PDO functions and with ODBC_* functions. With the same driver.

The database is SAP HANA.

Code:

        $driver = 'HDBODBC';
        $host = "XX.XX.XX.XX:30015";
        $db_name = "MY_DATABASE";
        $username = "XXX";
        $password = "XXXX";
        $conn = odbc_connect("Driver=$driver;ServerNode=$host;Database=$db_name;", $username, $password, SQL_CUR_USE_ODBC);

        $params = [
            'Belkin',
            '',
            '',
            'AL'
        ];
        $sql = 'SELECT * FROM "MY_DATABASE"."PRODUCT" (%s%s%s) LIMIT 10';
        $sql = sprintf($sql,"'",implode("','",$params),"'");

        $result = odbc_exec($conn,$sql);

        while($row = odbc_fetch_array($result)){
            dump($row);
            break;
        }

        $dsn = "odbc:Driver=$driver;ServerNode=$host;Database=$db_name";


        $dbh = new PDO($dsn, $username, $password);
        $stmt = $dbh->prepare($sql);
        $stmt -> execute();
        $result = $stmt->fetchAll(PDO::FETCH_ASSOC);

        dump($result[0]);

First dump returns:

Dump odbc functions

Second dump returns:

enter image description here

Asserting Lists (i.e., Non-Associative Arrays) in Tests: PHPUnit and Laravel HTTP Tests Without Considering Item Order

As you know when in PHPUnit we use assertEquals() and assertSame() and we pass arrays to them, they will assert arrays based on key-value pairs. So if the array is non-assoc array (list) and the order doesn’t matter, the tests will fail. Since these methods consider index as a key and compare the value for each corresponded key.
This problem can easily fixed by custom assertion method like this:

protected function assertListWithoutOrderEquals(array $expected, array $actual): void
{
    sort($expected);
    sort($actual);

    $this->assertEquals($expected, $actual);
}

But when we are in Laravel HTTP test and we have json to assert, Laravel will convert json to array and assert them based on these methods, I think, and I don’t have any idea to fix this problem here.

For example I have this test in Laravel and I have problem for asserting genres value.:

use IlluminateTestingFluentAssertableJson;

public function test_http_response(): void
{
    $expectedData = [
        'id' => 1,
        'name' => 'The fantastic book',
        'genres' => ['science-fiction', 'drama', 'mystery'],
        // other elements
    ];

    $response = $this->get('url');

    $response->assertJson(
        fn(AssertableJson $json) => $json->where('id', $expectedData['id'])
            ->where('name', $expectedData['name'])
            ->where('genres', $expectedData['genres']) // This is order sensitive and makes tests to fail.
            ->etc()
    );
}

I tried this but it’s messy. I’m looking for a better and cleaner solution if you can help me.

->where('genres', fn($genres) => $genres->diff($expectedData['genres'])->isEmpty() && $genres->count() == count($expectedData['genres']))

To explain better, Laravel will convert json array to collection, so I checked diff() and since diff() is an one way method, I mean it checks that all items in first array exist in second array and don’t consider extra items in second array, I checkd the size of them as well.

password_hash() cannot recognize my password correctly [duplicate]

I know I registered ” 1 ” as the password but as I check the password stored in the DB using password_verify(), it can’t be recognized correctly. Can someone point out what I did wrong? If I use md5() or sha1() it works fine but I know, this is a more secure implementation of hashing password.

handleForms.php

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

    $username = sanitizeInput($_POST['username']);
    $first_name = sanitizeInput($_POST['first_name']);
    $last_name = sanitizeInput($_POST['last_name']);
    $password = $_POST['password'];
    $confirm_password = $_POST['confirm_password'];

    if (!empty($username) && !empty($first_name) && !empty($last_name) && !empty($password) && !empty($confirm_password)) {

        if ($password == $confirm_password) {

            $insertQuery = insertNewUser($pdo, $username, $first_name, 
                $last_name, password_hash($_POST['password'], PASSWORD_DEFAULT));

            if ($insertQuery) {
                header("Location: ../login.php");
            }
            else {
                header("Location: ../register.php");
            }

        }

        else {
            $_SESSION['message'] = "Please make sure that both passwords are equal";
            header("Location: ../register.php");
        }
    }

    else {
        $_SESSION['message'] = "Please make sure that all input fields are not empty!";
        header("Location: ../register.php");
    }
}

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

    $username = sanitizeInput($_POST['username']);
    $password = $_POST['password'];

    if (!empty($username) && !empty($password)) {

        $loginQuery = loginUser($pdo, $username, $password);
        $userIDFromDB = $loginQuery['user_id']; 
        $usernameFromDB = $loginQuery['username']; 
        $passwordFromDB = $loginQuery['password'];

        echo "WHAT YOU TYPED: " . $password . "<br>";
        echo "FROM THE DB: " . $passwordFromDB . "<br>";

        if (password_verify($password, $passwordFromDB)) {
            echo "YES EQUAL";
        }

        else {
            echo "NOT EQUAL";
        }
    
    }

    else {
        $_SESSION['message'] = "Please make sure the input fields 
        are not empty for the login!";
        header("Location: ../login.php");
    }
 
}

models.php

function insertNewUser($pdo, $username, $first_name, $last_name, $password) {

    $checkUserSql = "SELECT * FROM user_accounts WHERE username = ?";
    $checkUserSqlStmt = $pdo->prepare($checkUserSql);
    $checkUserSqlStmt->execute([$username]);

    if ($checkUserSqlStmt->rowCount() == 0) {

        $sql = "INSERT INTO user_accounts (username, first_name, last_name, password) VALUES(?,?,?,?)";
        $stmt = $pdo->prepare($sql);
        $executeQuery = $stmt->execute([$username, $first_name, $last_name, $password]);

        if ($executeQuery) {
            $_SESSION['message'] = "User successfully inserted";
            return true;
        }

        else {
            $_SESSION['message'] = "An error occured from the query";
        }

    }
    else {
        $_SESSION['message'] = "User already exists";
    }

    
}

function loginUser($pdo, $username, $password) {

    $sql = "SELECT * FROM user_accounts WHERE username=?";
    $stmt = $pdo->prepare($sql);
    $stmt->execute([$username]); 

    if ($stmt->rowCount() == 1) {
        $userInfoRow = $stmt->fetch();
        return $userInfoRow;
    }

}

WooCommerce: Custom Price Update Issue on Variation Change with custom fields

I am trying to add custom fields to my WooCommerce site to update the price based on the warranty status selected by the customer when choosing a product variation. Specifically, I want the price to adjust according to whether the warranty is expired, within 1-6 months, over 6 months, or unactivated.

screenshot

I have implemented the following code, which correctly displays the warranty options and the adjusted price on the page. However, the price does not update correctly when changing variations, leading to calculation errors. Here’s my code:

add_action('woocommerce_single_variation', 'add_custom_options', 5);
function add_custom_options() {
    ?>
    <div class="custom-options-wrapper" style="width: 100%;">
        <h4>Great, let's talk about the more details:</h4>
        <div class="custom-warranty-option" style="margin-bottom: 20px;">
            <label>1. Is it still under warranty?</label>
            <label style="display: block;">
                <input type="radio" name="warranty_status" value="no" required> No, the warranty has expired.
            </label>
            <label style="display: block;">
                <input type="radio" name="warranty_status" value="1-6months" required> Yes, 1-6 months warranty
            </label>
            <label style="display: block;">
                <input type="radio" name="warranty_status" value="over6months" required> Yes, over 6 months warranty
            </label>
            <label style="display: block;">
                <input type="radio" name="warranty_status" value="unactivated" required> Yes, 1 year warranty & unactivated
            </label>
        </div>
    </div>

    <script type="text/javascript">
    jQuery(document).ready(function($) {
        var originalPrice;

        function getOriginalPrice() {
            var priceText = $('.woocommerce-variation-price .woocommerce-Price-amount.amount').first().text();
            return parseFloat(priceText.replace(/[^d.]/g, ''));
        }

        function updatePrice() {
            if (isNaN(originalPrice)) {
                originalPrice = getOriginalPrice();
            }

            var warrantyMultiplier = 1.00;

            if ($('input[name="warranty_status"]:checked').val() === 'no') {
                warrantyMultiplier = 0.90; // No warranty, deduct 10%
            } else if ($('input[name="warranty_status"]:checked').val() === '1-6months') {
                warrantyMultiplier = 0.92; // 1-6 months warranty, deduct 8%
            } else if ($('input[name="warranty_status"]:checked').val() === 'over6months') {
                warrantyMultiplier = 0.95; // Over 6 months warranty, deduct 5%
            }

            var newPrice = Math.round(originalPrice * warrantyMultiplier);

            $('.woocommerce-variation-price .woocommerce-Price-amount.amount').html('<bdi><span class="woocommerce-Price-currencySymbol">$</span>' + newPrice + '</bdi>');

            // Update hidden input to ensure the new price is used when added to the cart
            $('#custom_price').val(newPrice);
        }

        // Clear the selected state of all custom options
        function resetCustomOptions() {
            $('input[name="warranty_status"]').prop('checked', false);
        }

        $('form.variations_form').on('woocommerce_variation_has_changed', function() {
            resetCustomOptions();  // Reset custom options
            originalPrice = getOriginalPrice();  // Get new price each time a variation is switched
            updatePrice();
        });

        $('input[name="warranty_status"]').change(function() {
            updatePrice();
        });

        originalPrice = getOriginalPrice();
        updatePrice();
    });
    </script>
   
    <?php
}

Main Issue: When a user switches between variations, the price does not correctly update based on the selected warranty status. How can I ensure the price is recalculated and updated when the variation changes?
I would appreciate any suggestions to resolve this issue! Thank you!

How to resolve download excel file from azure environment with web app does not work?

I have a simple PHP app with functionality for downloading an Excel file. On my local machine, using XAMPP, users can download the Excel sheet without issues. However, after deploying the PHP app to an Azure Web App environment, the Excel download function no longer works

I am using xampp with php version: PHP Version 8.2.12 and on the azure environment I am using: Major version 8 and Minor version:8

This is the output if a user tries to download an excel file:

PKZJ^YG�D�Z�[Content_Types].xmlSV���N�0E�|E�-J��@5��*Q>`�'�UǶl���L����@�nbE�gr=��tW�d�>(k 6�r��V*�,���)�cI�`$hk�`{l:�/�CBb V���9��Bf�RZ_C�W��� ��o���k"���ƃM�/��Jb2��&�i� ��(#?�X?c���k�*�(_�����}�>���k�PKZJ^Y�78�K_rels/.relsSV���j�0��{ �{���1F�^ʠ�2��l�$���-}

And with devtools I don’t see any errors.

I checked in

azure Advanced Tools –> Go –> index of WWWROOT.

And I see the vendor folder in it with also the composer.json in it. So the libraries are available.

And this is the function for download the excel file:

<?php
  require 'vendor/autoload.php';
  use PhpOfficePhpSpreadsheetSpreadsheet;
  use PhpOfficePhpSpreadsheetWriterXlsx;

function exportKvKNumbersToExcel(array $kvkNumbers, $dateInput)
        {

            ob_start();
            ob_clean();
            $spreadsheet = new Spreadsheet();
            $sheet = $spreadsheet->getActiveSheet();
            $sheet->setTitle('KvK Numbers');


            $sheet->setCellValue('A1', 'KvK Number');
            $row = 2;
            foreach ($kvkNumbers as $kvkNumber) {
                $sheet->setCellValue('A' . $row, $kvkNumber);
                $row++;
            }


            $writer = new Xlsx($spreadsheet);
            $fileName = 'KvK_Numbers_'. $dateInput .'_' . date('Y-m-d_H-i-s') . '.xlsx';
            ob_end_clean();


            header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
            header('Content-Disposition: attachment; filename="' . $fileName . '"');
            header('Cache-Control: max-age=0');


            $writer->save('php://output');
            exit;
        }    

Do I have to set some settings in the azure environment?

Question: How to download an excel file from the azure environment?

Best way to clean a user submitted email? (PHP) [closed]

What is the best way in PHP to clean an email address that a user submits in an input field?

$cleanRegEmail = preg_replace('/\s+/', "-", trim(preg_replace('/[^A-Za-z0-9]/', " ", $regEmail)));

the above code incorrectly cleans the email to: prefix-gmail-com (it removes the @ and the .)

thanks

How to have different versions of PHP syntax coexist?

In my PHP file this line of code:

private const string NS_HTML = 'http://www.w3.org/1999/xhtml';

only works for PHP 8.3 or after.

If I want to make my library compatible to 8.2, is downgrading the syntax the only way to go? i.e.

private const NS_HTML = 'http://www.w3.org/1999/xhtml';

What I really want to achieve is some sort of magic like:

if (PHP_VERSION >= '8.3') {
  private const string NS_HTML = 'http://www.w3.org/1999/xhtml';
} else {
  private const NS_HTML = 'http://www.w3.org/1999/xhtml';
}

You may argue dropping the type constraint from a constant is not a big deal, but I am just giving out a simple example. Another 8.3 feature I use is the #[Override] attribute and I would love to keep them.

Update: based on answer from How can I code for multiple versions of PHP in the same file without error?:

This would work:

if (PHP_VERSION_ID >= 803000) {
    require_once __DIR__ . '/class-a-php8.3.php';
} else {
    require_once __DIR__ . '/class-a-php8.2.php';
}

While this won’t:

if (PHP_VERSION_ID >= 803000) :
    class A {
        private const string NS_HTML = 'http://www.w3.org/1999/xhtml';
        ...
    }
else:
    class A {
        private const NS_HTML = 'http://www.w3.org/1999/xhtml';
        ...
    }
endif;

i.e. different versions of syntax must sit in separate files.

How to deploy Laravel Reverb in production with Cyberpanel?

I can’t get Laravel Reverb to work for me on my server with cyberpanel.
I have configured everything well, when I test my application from local pointing without SSL(WS) I can connect and so far so good, but when I uploaded it to keep it in production is where I find the problem:

WebSocket connection to'wss://domain.com/app/sdfsdsdf323?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed:

I have tried many things from setting up reverse proxy and I get nothing, I can’t get it to work.
Has anyone here configured Laravel Reverb in Cyberpanel?
Here are my configurations.
Laravel .env

REVERB_APP_ID=123456
REVERB_APP_KEY=sdfsdsdf323
REVERB_APP_SECRET=sdfsdsdf323
REVERB_SERVER_HOST="127.0.0.1"
REVERB_SERVER_PORT=8080
REVERB_HOST="domain.com"
REVERB_PORT=443
REVERB_SCHEME=http
REVERB_LOCAL_CERT="/etc/letsencrypt/live/domain.com/cert.pem"
#REVERB_LOCAL_PK="/etc/letsencrypt/live/domain.com/privkey.pem"

React .env

REACT_APP_REVERB_APP_KEY=sdfsdsdf323
REACT_APP_REVERB_HOST=domain.com
REACT_APP_REVERB_PORT=443
REACT_APP_REVERB_SCHEME=https
REACT_APP_REVERB_PATH="/ws"

Laravel Echo configuration

window.Pusher = Pusher;
    window.Echo = new Echo({
        broadcaster: 'reverb',
        key: process.env.REACT_APP_REVERB_APP_KEY,
        wsHost: process.env.REACT_APP_REVERB_HOST,
        wsPort: process.env.REACT_APP_REVERB_PORT ?? 8080,
        wssPort: process.env.REACT_APP_REVERB_PORT ?? 443,
        
//wsPath: process.env.REACT_APP_REVERB_PATH ?? "/",
        forceTLS: (process.env.REACT_APP_REVERB_SCHEME ?? 'https') === 'https',
        enabledTransports: ['ws','wss'],
        authorizer: (channel, options) => {
            return {
                authorize: (socketId, callback) => {
                    axios.post('/api/broadcasting/auth', {
                        socket_id: socketId,
                        channel_name: channel.name
                    })
                    .then(response => {
                        callback(null, response.data);
                    })
                    .catch(error => {
                        callback(error);
                    });
                }
            };
        },
    });

The application works fine when it is local. I have the websocket server on a VPS with cyberpanel and then run the React app locally, The application works fine when it is local as I mentioned, but when I deploy it to production on a hosting is when it gives the problem that does not connect, I read that it is a certificate issue but try to configure it and then I got no luck.
Some other discussions I was consulting but I tried to do everything they said and got no luck at all.
https://github.com/laravel/reverb/issues/107
https://github.com/laravel/framework/discussions/50675

slim framework firebase push notification

I’m using the Slim framework as a PHP API and I’m sending Firebase push notifications on my website. The problem is that when I try to add data to the notification, I receive two notifications for a single send. Can you help me, please?

I’m using the Slim framework as a PHP API and I’m sending Firebase push notifications on my website. The problem is that when I try to add data to the notification, I receive two notifications for a single send.

Laravel Filament – Hide resource actions on reorder

I have a project that includes a custom Laravel Filament CMS. In this CMS i have a resource that contains some actions like view/edit/delete defined in my table(Table $table) method in the resource:

$table
    ->reorderable('sort_index')
    ->actions([
        TablesActionsViewAction::make(),
        TablesActionsEditAction::make(),
    ])

These actions are properly displayed on the end of each entry of this resource

Resource entry containing actions

The issue I am facing is that when I reorder the resource entries using the reorder button on the top right, it hides both the action buttons and the pagination controlls. After some time I figured out i can stop the pagination from hiding using ->paginatedWhileReordering() however there does not seem to be any similar method for having the actions while reordering.

Is this even possible without making an entire wrapper around the table view, just for the action buttons to show? and if not, what would be the easiest way to make such a wrapper?

Thanks in advance!