Securely Authenticating a React Native App with an Osclass Backend Lacking a Password Verification API Endpoint

I’m developing a React Native (Expo) app for an Osclass (PHP) backend, and I’m facing a critical authentication issue. The website’s REST API plugin has no login endpoint; it does not provide a method to verify a plain-text password against the stored Bcrypt ($2y$) hash.

I need to implement a secure login flow, but I have strict project constraints:

No Client-Side Verification: This is insecure as it would expose the hash, and it’s non-functional because it wouldn’t generate the required API token for subsequent requests.

No Server-Side Middleware: I cannot add a custom gateway (e.g., Laravel/Node.js) to handle the login logic.

No WebView: I cannot use a WebView to wrap the website’s existing login form.

Given this technical impasse, is there any established, secure pattern to authenticate a native app under these conditions? Or is the only viable solution to modify the backend PHP plugin to add the missing login functionality?

No rule to make target ‘/opt/homebrew/Cellar/openssl@3/3.4.1/include/openssl/opensslv.h’ installing php 8.4.11

I’m trying to install PHP 8.4.11 from source–please don’t tell me I should just be installing it from homebrew–on a M1 MacMini running Sequoia 15.5.

When issuing the make command, I get the following output:

/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/php_date.c -o ext/date/php_date.lo  -MMD -MF ext/date/php_date.dep -MT ext/date/php_date.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/astro.c -o ext/date/lib/astro.lo  -MMD -MF ext/date/lib/astro.dep -MT ext/date/lib/astro.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/dow.c -o ext/date/lib/dow.lo  -MMD -MF ext/date/lib/dow.dep -MT ext/date/lib/dow.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/parse_date.c -o ext/date/lib/parse_date.lo  -MMD -MF ext/date/lib/parse_date.dep -MT ext/date/lib/parse_date.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/parse_tz.c -o ext/date/lib/parse_tz.lo  -MMD -MF ext/date/lib/parse_tz.dep -MT ext/date/lib/parse_tz.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/parse_posix.c -o ext/date/lib/parse_posix.lo  -MMD -MF ext/date/lib/parse_posix.dep -MT ext/date/lib/parse_posix.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/timelib.c -o ext/date/lib/timelib.lo  -MMD -MF ext/date/lib/timelib.dep -MT ext/date/lib/timelib.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/tm2unixtime.c -o ext/date/lib/tm2unixtime.lo  -MMD -MF ext/date/lib/tm2unixtime.dep -MT ext/date/lib/tm2unixtime.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/unixtime2tm.c -o ext/date/lib/unixtime2tm.lo  -MMD -MF ext/date/lib/unixtime2tm.dep -MT ext/date/lib/unixtime2tm.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/parse_iso_intervals.c -o ext/date/lib/parse_iso_intervals.lo  -MMD -MF ext/date/lib/parse_iso_intervals.dep -MT ext/date/lib/parse_iso_intervals.lo
/bin/sh /Users/jnorris/Downloads/php/php-8.4.11/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/ -I/Users/jnorris/Downloads/php/php-8.4.11/main -I/Users/jnorris/Downloads/php/php-8.4.11 -I/Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib -I/opt/homebrew/Cellar/openssl@3/3.4.1/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.10/include -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl -I/Users/jnorris/Downloads/php/php-8.4.11/ext/mbstring/libmbfl/mbfl -I/Users/jnorris/Downloads/php/php-8.4.11/TSRM -I/Users/jnorris/Downloads/php/php-8.4.11/Zend  -D_GNU_SOURCE -pthread  -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -O2 -ffp-contract=off -fvisibility=hidden -pthread -O0 -DZTS -DZEND_SIGNALS    -Wno-implicit-fallthrough -Iext/date/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1 -c /Users/jnorris/Downloads/php/php-8.4.11/ext/date/lib/interval.c -o ext/date/lib/interval.lo  -MMD -MF ext/date/lib/interval.dep -MT ext/date/lib/interval.lo
make: *** No rule to make target `/opt/homebrew/Cellar/openssl@3/3.4.1/include/openssl/opensslv.h', needed by `ext/openssl/openssl.lo'.  Stop.

I think the issue is that in each line of the above output, there is /opt/homebrew/Cellar/openssl@3/3.4.1/include when this is not the version of openssl@3 I have installed–when I issue the command:

$ openssl version

the response is:

LibreSSL 3.3.6

I have, in this order:

$ brew link --force openssl@3
Linking /opt/homebrew/Cellar/openssl@3/3.6.0... 6547 symlinks created.
$ brew uninstall libressl
Error: No such keg: /opt/homebrew/Cellar/libressl
$ sudo rm -rf /usr/local/lib/libressl*
[no response]
$ sudo rm -rf /usr/local/bin/libressl*
[no response]
$ brew reinstall openssl@3
brew install openssl@3
Warning: openssl@3 3.6.0 is already installed and up-to-date.
$ openssl version
LibreSSL 3.3.6

https://formulae.brew.sh/formula/openssl@3 does not mention “LibreSSL”–is this what homebrew should install? I was expecting openssl (or something like this, not LibreSSL).

Any ideas as to what is going wrong will be greatly appreciated!

Cant compose container [closed]

2025/10/12 18:41:05 [error] 25#25: *5 FastCGI sent in stderr: “PHP message: PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.2.5”. You are running 5.6.40-86+ubuntu22.04.1+deb.sury.org+1. in /var/www/php/vendor/composer/platform_check.php on line 25″ while reading response header from upstream, client: 127.0.0.1, server: , request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “localhost”
[nginx] time=2025-10-12T18:41:05+00:00|status=500|server_name=
|hostn
ame=dev_upi.cb9a1wkrt2pc1kesh8b3dqqfm.local|remote_addr=127.0.0.1|request_method=GET|request=GET / HTTP/1.1|referer=-|request_length=73|request_time=0.001|bytes_sent=464|EOL
Shutdown container

When composing container, this error shows, docker nginx php56 on ubuntu

I except a compose of container, tried Cursor AI, i was migrating docker container sources from php83 to php56

retrieve from an array and/or subarray [closed]

I have the following array/subarray. How would I go about retrieving the data from the array to run an update query:

    Array
(
    [court] => Array
        (
            [442] => ccal11
            [443] => ccal222
        )

    [judge] => Array
        (
            [442] => Robert Harper11
            [443] => Harriett L Haag22
        )

    [address] => Array
        (
            [442] => 300 Oak St Ste 500
Abilene TX 7960211
            [443] => 300 Oak St Ste 501
Abilene TX 7960222
        )

    [phone] => Array
        (
            [442] => 325-674-132311
            [443] => 325-674-120822
        )

Custom File upload Component in Livewire Laravel

I am trying to create a reusable Livewire input-file component, Such that :

  1. Easy embed in any (parent) and pass the model name (ex = “file1”)
  2. How to store() the file is in control of (parent) Form

So far, I have created a child component and a parent form. The problem is that in return, I get a “string” and not a file object from Livewire component. Can anyone help in correcting the thing or even suggest how to do it in a better way?

SingleFileUpload(component)

<?php

namespace AppLivewire;

use LivewireComponent;
use LivewireAttributesModelable;
use LivewireWithFileUploads;

class SingleFileUpload extends Component
{
    use WithFileUploads; 
    #[Modelable]          // lets parent bind with wire:model="file1"
    public $value = null; // receives TemporaryUploadedFile from Livewire

    /** Public props to customize UI/behavior */
    public string $label   = 'Upload file';
    public string $accept  = '';        // e.g. "image/png,image/jpeg"
    public bool   $multiple = false;    // set true if you enable multi
    public ?string $errorKey = null;    // parent field name for @error display

    public function render()
    {
        return view('livewire.single-file-upload');
    }
}

Blade File

// other code for div styles  ....
    <input
        type="file"
        wire:model.live="value"
        @if($accept) accept="{{ $accept }}" @endif
        @if($multiple) multiple @endif
        class="file-input file-input-bordered w-full"
    />

// Other code for progress bar ...

Usage In parent form
Blade

<livewire:single-file-upload wire:model="file1" :label="'Photo 1'" accept="*" :errorKey="'file1'" />

FormCompoenent

class FormComp extends Component
{
 use WithFileUploads; 
 public function save($method)
    {
        $this->validate(); 
        $stored1 = $this->file1->store('frt_api/uploads/' . $timestamped_folder_path); //<--- Fails recived a string instead of file
    }
}

If I dd($this->file1) , I get livewire-file:eCQNvlZlJu4j15E88m9Rt98BXUW4wU-metacGVyZmVjdGNyb3BpY29udXNlci5wbmc=-.png hence unable to figure out how to store it on parent side

WalletPass Notification API Returns 200 but No Push Notification Received

Problem:
When using the WalletPass Notification API to push updates to a pass, the API returns a 200 OK response, indicating success. However, no push notification is actually delivered to the WalletPass app, and the pass does not update as expected.

Expected Behavior:
A notification should be sent to the WalletPass app, prompting the pass to refresh and display updated information.

Actual Behavior:
The API call returns a successful response (HTTP 200), but no notification appears, and the pass remains unchanged.

Steps to Reproduce:

Send a POST request to the WalletPass Notification API endpoint with a valid pushToken or serialNumber.

Observe that the response is 200 OK.

Check the WalletPass app — no notification or pass update occurs.

Additional Notes:

The issue is reproducible with multiple passes.

The payload and authentication are confirmed valid.

No error or failure message is returned by the API.

What causes the failure to display all article comments in my Laravel 8 blogging application?

I am working on a blogging application (link to GitHub pull request) in Laravel 8.

In appHttpControllersArticlesController.php I have methods for displaying article details, with comments included:

class ArticlesController extends FrontendController
{
    protected $per_page = 12;
    protected $comments_per_page = 10;
    protected $comments_orderby_direction = 'desc';

    public function show($slug)
    {
        $article = Article::visible()->where('slug', $slug)->firstOrFail();

        // Throttle views
        $sessionKey = 'article_viewed_' . $article->id;
        $lastViewedAt = session($sessionKey);
        if (!$lastViewedAt || Carbon::createFromTimestamp($lastViewedAt)->diffInMinutes(now()) >= 60) {
            $article->increment('views');
            session()->put($sessionKey, now()->timestamp);
        }

        // Older article
        $old_article = Article::visible()
            ->where(function ($q) use ($article) {
                $q->where('published_at', '<', $article->published_at)
                  ->orWhere(function ($q2) use ($article) {
                      $q2->where('published_at', $article->published_at)
                         ->where('id', '<', $article->id);
                  });
            })
            ->orderBy('published_at', 'desc')
            ->orderBy('id', 'desc')
            ->first();

        // Newer article
        $new_article = Article::visible()
            ->where(function ($q) use ($article) {
                $q->where('published_at', '>', $article->published_at)
                  ->orWhere(function ($q2) use ($article) {
                      $q2->where('published_at', $article->published_at)
                         ->where('id', '>', $article->id);
                  });
            })
            ->orderBy('published_at', 'asc')
            ->orderBy('id', 'asc')
            ->first();

        // Approved top-level comments with approved replies
        $comments = Comment::where('article_id', $article->id)
            ->where('approved', 1)
            ->whereNull('parent_id')
            ->with(['replies' => function ($query) {
                $query->where('approved', 1);
            }])
            ->orderBy('id', 'desc')
            ->get();

        $comments_count = $comments->count();

        return view(
            'themes/' . $this->theme_directory . '/templates/single',
            array_merge($this->data, [
                'categories'        => $this->article_categories,
                'article'           => $article,
                'old_article'       => $old_article,
                'new_article'       => $new_article,
                'comments'          => $comments,
                'comments_count'    => $comments_count,
                'comments_per_page' => $this->comments_per_page,
                'tagline'           => $article->title,
                'is_infinitescroll' => false
            ])
        );
    }

    public function get_comments_ajax(Request $request)
    {
        if (!$request->ajax()) exit();

        $article_id  = $request->post('article_id');
        $page_number = $request->post('page');
        $offset      = $this->comments_per_page * $page_number;
        $more_comments_to_display = true;

        $data['comments'] = $this->get_commentQuery($article_id, $this->comments_per_page, $offset)->get();
        $content = '';
        if ($data['comments']->count()) {
            $content .= view(
                'themes/' . $this->theme_directory . '/partials/comments-list',
                array_merge($data, [
                    'is_infinitescroll' => $this->is_infinitescroll,
                    'theme_directory'   => $this->theme_directory,
                    'article_id'        => $article_id
                ])
            );
        } else {
            $more_comments_to_display = false;
        }

        echo json_encode([
            'html' => $content,
            'page' => $page_number,
            'more_comments_to_display' => $more_comments_to_display,
            'article_id' => $article_id
        ]);
        exit();
    }

    private function get_commentQuery(int $article_id, int $limit = 0, int $offset = 0): object
    {
        $commentQuery = Comment::where(['article_id' => $article_id, 'approved' => 1])
            ->orderBy('id', $this->comments_orderby_direction)
            ->with(['replies' => function ($query) {
                $query->where('approved', 1);
            }]);

        if ($offset > 0) $commentQuery = $commentQuery->offset($offset);
        if ($limit > 0)  $commentQuery = $commentQuery->limit($limit);

        return $commentQuery;
    }
}

The comment model:

class Comment extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'article_id',
        'parent_id',
        'body',
        'approved'
    ];

        // Join users to comments
        public function user() {
            return $this->belongsTo(User::class);
        }

        // Join articles to comments
        public function article() {
            return $this->belongsTo(Article::class);
        }

        // Join comment replies to comments
        public function replies() {
          return $this->hasMany(Comment::class, 'parent_id');
        }
}

The Blade list of comments (and replies):

@if ($comments && count($comments))
    <div class="comments mt-4" id="comments_container">
        @foreach ($comments as $comment)
            @if (is_null($comment->parent_id))
                <div x-data="{ showEdit: false, showReply: false }" class="card bg-light comment mb-3" id="comment-{{ $comment->id }}">
                    <h5 class="card-header">
                        <span class="row">
                            <span class="col-md-6 text-dark avatar">
                                <img src="{{ asset('images/avatars/' . $comment->user->avatar) }}"
                                    alt="{{ $comment->user->first_name }} {{ $comment->user->last_name }}"
                                    class="rounded-circle me-1">
                                {{ $comment->user->first_name }} {{ $comment->user->last_name }} says:
                            </span>
                            <span class="col-md-6 text-dark d-none d-md-flex align-items-center justify-content-end">
                                {{ date('jS M Y', strtotime($comment->created_at)) }}
                            </span>
                        </span>
                    </h5>

                    <div class="card-body bg-white p-2">
                        <p class="comment__text">{{ $comment->body }}</p>
                        <ul class="comment-actions list-unstyled">
                            @if (Auth::check() && $comment->user->id !== Auth::id())
                                <li>
                                    <a class="comment-reply" @click.prevent="showReply = !showReply">
                                        <i class="fa-regular fa-comments"></i>
                                        <span x-text="showReply ? 'Cancel' : 'Reply'"></span>
                                    </a>
                                </li>
                            @endif
                            @if (Auth::check() && $comment->user->id === Auth::id())
                                <li>
                                    <a class="comment-edit" @click.prevent="showEdit = !showEdit">
                                        <i class="fa-regular fa-pen-to-square"></i>
                                        <span x-text="showEdit ? 'Cancel' : 'Edit'"></span>
                                    </a>
                                </li>
                                <li>
                                    @include(
                                        'themes/' . $theme_directory . '/partials/comment-delete-form',
                                        ['commentOrReply' => $comment]
                                    )
                                </li>
                            @endif
                        </ul>

                        {{-- Edit form --}}
                        <div class="mt-2 comment-edit-form-wrapper" x-show="showEdit" x-transition>
                            @include('themes/' . $theme_directory . '/partials/comment-edit-form', [
                                'commentOrReply' => $comment,
                            ])
                        </div>

                        {{-- Reply form --}}
                        @if (Auth::check())
                            <div class="mt-2 reply-form" x-show="showReply" x-transition>
                                @include('themes/' . $theme_directory . '/partials/comment-form', [
                                    'article' => $article,
                                    'parent_id' => $comment->id,
                                ])
                            </div>
                        @endif
                    </div>

                    {{-- Replies --}}
                    @if ($comment->replies && count($comment->replies))
                        <div class="replies ps-4 mt-3">
                            @foreach ($comment->replies as $reply)
                                <div x-data="{ showEdit: false }" class="card bg-light comment mb-2 me-2"
                                    id="comment-{{ $reply->id }}">
                                    <h5 class="card-header">
                                        <span class="row">
                                            <span class="col-md-6 text-dark avatar">
                                                <img src="{{ asset('images/avatars/' . $reply->user->avatar) }}"
                                                    alt="{{ $reply->user->first_name }} {{ $reply->user->last_name }}"
                                                    class="rounded-circle me-1">
                                                {{ $reply->user->first_name }} {{ $reply->user->last_name }} says:
                                            </span>
                                            <span
                                                class="col-md-6 text-dark d-none d-md-flex align-items-center justify-content-end">
                                                {{ date('jS M Y', strtotime($reply->created_at)) }}
                                            </span>
                                        </span>
                                    </h5>

                                    <div class="card-body bg-white p-2">
                                        <p class="comment__text">{{ $reply->body }}</p>
                                        <ul class="comment-actions list-unstyled">
                                            @if (Auth::check() && $reply->user->id === Auth::id())
                                                <li>
                                                    <a class="comment-edit" @click.prevent="showEdit = !showEdit">
                                                        <i class="fa-regular fa-pen-to-square"></i>
                                                        <span x-text="showEdit ? 'Cancel' : 'Edit'"></span>
                                                    </a>
                                                </li>
                                                <li>
                                                    @include(
                                                        'themes/' .
                                                            $theme_directory .
                                                            '/partials/comment-delete-form',
                                                        ['commentOrReply' => $reply]
                                                    )
                                                </li>
                                            @endif
                                        </ul>

                                        {{-- Edit form --}}
                                        <div class="mt-2 comment-edit-form-wrapper" x-show="showEdit" x-transition>
                                            @include(
                                                'themes/' . $theme_directory . '/partials/comment-edit-form',
                                                ['commentOrReply' => $reply]
                                            )
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>
                    @endif
                </div>
            @endif
        @endforeach
    </div>
@endif

The problem

When loading comments on page scroll via AJAX is disabled (I have an option in the “Settings” section of the CMS for that), for a reason I was unable to spot, not all the article comments and replies are loaded, although I have approved all comments related to the article I checked.

I suspect the bug is in the ArticlesController, but I was unable to spot it.

This pat seems redundant because there is a get_commentQuery method already:

// Approved top-level comments with approved replies
$comments = Comment::where('article_id', $article->id)
        ->where('approved', 1)
        ->whereNull('parent_id')
        ->with(['replies' => function ($query) {
            $query->where('approved', 1);
        }])
        ->orderBy('id', 'desc')
        ->get();
  1. What is the reason for this bug?
  2. What is the most robust way to fix it?

::whereUuid() is not defined in laravel php

I am trying to get the order that has the client and service as a foreignkey with whereUuid with this line of code:

$order = Order::whereUuid($order_id)->with(['client', 'service'])->first();

But the intellisense is showing me this error, although I did not see any error on the logs. Or I don’t know how to check for error logs in laravel that is running in a docker container.

Method Order::whereUuid() is not defined. The call is passed to the magic Model::__callStatic() method.PHP(PHP6615)

Please can you help me solve this or if there is a better approach to handle the matter, I will appreciate it. Thank you.

Best way to implement User Progress and Tracking their Progress? [closed]

I have a website where there are many users. There are some training involved. When users first start using the website (newbies).

I would like to lock or hide certain parts of the website or simply grey out the buttons UNTIL user has done the training module for that section before using that feature.

What is the best way to implment this type of structure?

There is not just a few sections. Also users may skip a module and do a different learning module first and do it in different order. So there is not ordered level number.

E.g. User might do learning Module A, B, C, E and F, M and O

So I would like to unlock / unhide features A B C, E and F. M and O feature. But for example Feature D would be greyed out or not available to them.

Also would it affect page load speed if I am checking all the time making a call to the database if they user has done the module or not? Would I user another field to store a true or false boolean?

I don’t wanna have a large table with heaps and heaps of fields just to store true or false šŸ™ or this is industty standard?

Summary of Challenges:
There could be a large number of learning modules.
I wanna only unlock that part of the website after they have done the module.
By the end majority of all users would have done all the learning modules in the end.
I don’t want the website to be very slow for page load speed checking this for regular users.

What’s the best way to go about it? Or should I just have a level number. Where their level is the highest module that they have completed that doesn’t skip a module. e.g. Module A, B, C, E and F, M and O So even thou they have completed higher modules their level is only level 3 since they only completed A B and C?

I haven’t tried anything. I only began thinking about this design and thinking about the problem.

I would like to get insight on how profressional programmers would tackle this problem.

What database structure would you use?

PhpWord generates paragraph breaks in addhtml

I am using PHPWord from within PHP to generate a word docment. I do use addHtml to transform some Mysql text containing multiple lines into a Word paragraph.

My input text contains:

<pre>
Lorem ipsum dolor sit amet, 
&lt;span style="font_weight:bold"&gt;consectetur adipiscing elit.&lt;/span&gt;
Quisque pretium mi a risus interdum, eu mollis nulla viverra. 
</pre>

Each line is separated with a carriage return (n). I tried to process the lines one by one (adding a n for each line, or use the complete text, result is the same.
Whatever I use (nl2br or str_replace) to transform the n into &lt;br /&gt; before handling addHtml generates:

Meaning a double paragraph separator instead of a single line separator.

How can this be solved? Or is this a known issue?

What is the correct context to consume a RabbitMQ broker within the PHP/laravel ecosystem?

Well, to give you some context. We have a system that captures telemetry data in real time. The broker we hire sends telemetry data in real time from the device they place inside our cars. This operation has been running for two years, but we’ve been trying to troubleshoot and improve it for two years.

It turns out that after fixing numerous flaws, we started comparing what leaves their broker with what arrives at our database. We noticed that some packets simply don’t arrive, either in the data lake (raw message) or in the processed database. So we added more logs and started investigating. I noticed recurring Queue Error: Broken Pipe Or Closed Connection errors. But at the same time, when we see this error and go to the database, packets still arrive, so the consumer doesn’t crash and stop acquiring packets, losing that one. We set no_ack to true because we use the consumer in the Laravel schedule, running with cron 8x daily. And setting no_ack to false would trigger a race condition for the packet that ended up giving an error.

I’d like to know what’s the best context for the consumer? Should it run in the supervisor, with auto-restart policies and running 100% in the background?

    $schedule->command('pad:cron')->weekdays()->daily();
    
            $schedule->command('x:consumir')->cron('00 04 * * *');
            $schedule->command('x:consumir')->cron('00 07 * * *');
            $schedule->command('x:consumir')->cron('00 10 * * *');
            $schedule->command('x:consumir')->cron('01 12 * * *');
            $schedule->command('x:consumir')->cron('0 15 * * *');
            $schedule->command('x:consumir')->cron('0 17 * * *');
            $schedule->command('x:consumir')->cron('00 20 * * *');
            $schedule->command('x:consumir')->cron('00 00 * * *');

if run command on server – px aux | grep “x:consumir”

1195277  0.0  0.0   7124  3200 ?        S    00:00   0:00 sh -c '/usr/bin/php' 'artisan' x:consumir > '/dev/null' 2>&1
1195278  0.5  0.4 277348 66736 ?        S    00:00   3:56 /usr/bin/php artisan x:consumir
1199299  0.0  0.0   7124  3328 ?        S    04:00   0:00 sh -c '/usr/bin/php' 'artisan' x:consumir > '/dev/null' 2>&1
1199300  0.7  0.4 277352 67100 ?        S    04:00   3:38 /usr/bin/php artisan x:consumir
1203839  0.0  0.0   7124  3328 ?        S    10:00   0:00 sh -c '/usr/bin/php' 'artisan' x:consumir > '/dev/null' 2>&1
1203840  1.2  0.4 277360 66964 ?        S    10:00   1:45 /usr/bin/php artisan x:consumir
1310719  0.0  0.0   7124  3328 ?        S    12:01   0:00 sh -c '/usr/bin/php' 'artisan' x:consumir > '/dev/null' 2>&1
1310720  0.9  0.4 277360 64436 ?        S    12:01   0:11 /usr/bin/php artisan x:consumir
1332376  0.0  0.0   6436  2432 pts/1    S+   12:21   0:00 grep --color=auto x:consumir

And this is the method to create the consumer:

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle(){
        try{
            $connection = new AMQPStreamConnection('xxx.xxx.xxx', xxxx, env('user_rabbit'), env('password_rabbit'),'/', env('parameter1_rabbit'), 'AMQPLAIN', null, 'en_US', 3.0, 30.0, null, false, 60, 0);
            $channel = $connection->channel();

            echo " [*] Waiting for messages. To exit press CTRL+Cn";

            $callback = function ($msg) {
                
                $retorno = json_decode($msg->body);
                //dd($retorno);
        
                $this->processar($retorno);
                
            };

            $channel->basic_consume(env('user_rabbit'), '', false, true, false, false, $callback);
            //consumer_tag =
            //no_local=
            //no_ack = this is true
            //exclusive =
            //nowait =

            while ($channel->is_consuming()) {
                $channel->wait();
            }

            $channel->close();
            //$connection->close();
            return true;
        }catch(Throwable $e){
            Log::debug('QUEUE ERROR: ' . $e->getMessage());
            Log::debug($e->getTrace());
            return true;
            //dd("parar2");
        }
    }

What do you say? Where else can I look? I must say the accuracy of the data is about 80%. But we need to get to at least 95%.

How can I split a full webpage screenshot into separate UI blocks (PHP library or API)? [closed]

Does anyone know tools that can take a full-page website screenshot and automatically split it into logical UI blocks (hero, header, cards, footer, etc.) and return each block as a separate image segment?

Ideally I’m looking for either:

  • a PHP library I can run on my server, or
  • an online service with an API (paid is fine)

image explanation

I did some research but, unfortunately, couldn’t find any suitable tools.

PHP LDAP sessions (how to preserve password for subsequent bind calls)

I’m struggling to figure out how to add ldap authentication to a webapp that I am writing to manage entries in the LDAP server itself.

I want users to be able to log into the webapp with their LDAP credentials and most importantly, bind with their credentials for subsequent LDAP queries.

The part that is tripping me up the most is this:

You’re supposed to bind when needed, and unbind when you are done. So while I can create a $_SESSION["username"] object, I’ve seen no examples of a $_SESSION["password"] object for subsequent LDAP bind calls. That being said, how do I incorporate start_session() and use ldap_bind (Which requires the password) correctly if not by creating a $_SESSION["password"] object?

Example class I am working on:

<?php
session_start();

class LdapAuthenticator {
    private $ldapConnection;
    private string $ldapUri;

    public function __construct(string $uri) {
        $this->ldapUri = $uri;
        $ldap_error_message = ldap_error($this->ldapConnection);
        if($this->ldapConnection === false) {
            throw new Exception($ldap_error_message);
        }
    }

    public function connect(): bool {
        $this->ldapConnection = ldap_connect($this->ldapUri);
        if ($this->ldapConnection) {
            ldap_set_option($this->ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
            ldap_set_option($this->ldapConnection, LDAP_OPT_REFERRALS, 0);
            return true;
        }
        return false;
    }

    public function bind(string $bind_dn, string $bind_pw): bool {
        if (!isset($this->ldapConnection)) {
            throw new Exception("LDAP connection not established. Call connect() first.");
        }
        $ldap_error_message = ldap_error($this->ldapConnection);
        if (!empty($ldap_error_message) && $ldap_error_message !== "Success") {
            if(ldap_get_option($this->ldapConnection, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error)) {
                throw new Exception("$ldap_error_message - $extended_error");
            } else {
                throw new Exception("$ldap_error_message");
            }
        }
        return ldap_bind($this->ldapConnection, $bind_dn, $bind_pw);
    }
                
    public function authenticate(string $username, string $password) {
        // Attempt to bind with user credentials
        if ($this->bind($username, $password) "uid={$username},{$this->baseDn}", $password) {
            $_SESSION['ldap_username'] = $username;
            // Optionally retrieve and store other user details
            return true;
        }
        return false;
    }

    public function isLoggedIn() {
        return isset($_SESSION['ldap_username']);
    }

    public function close(): void {
        if (isset($this->ldapConnection)) {
            ldap_unbind($this->ldapConnection);
        }
    }

    public function getError(): string {
        if (isset($this->ldapConnection)) {
            return ldap_error($this->ldapConnection);
        }
        return "No LDAP connection.";
    }

    public function search(string $filter, string $settings) {
        $search_result = ldap_search($this->ldapConnection, $settings, $filter);

        $ldap_error_message = ldap_error($this->ldapConnection);
        if (!empty($ldap_error_message) && $ldap_error_message !== "Success") {
            if(ldap_get_option($this->ldapConnection, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error)) {
                throw new Exception("$ldap_error_message - $extended_error");
            } else {
                throw new Exception("$ldap_error_message");
            }
        }
                return ldap_get_entries($this->ldapConnection, $search_result);
    }
    
}    
?>

Example page code I am trying to piece together:

<?
try {
    $host = "ldaps://ldap.example.com";
    $baseDn = "dc=example,dc=com";
    $ldap = new LdapAuthenticator($host);

    if ($ldap->connect()) {
        if (!$ldap->bind($_POST["username"], $_POST['password'])) {
            $htmlerror = $ldap->getError();
        } else {
            $htmlerror = $ldap->getError();
            // Proceed with other LDAP operations (search, modify, etc.)
            $entries = $ldap->search("(&(objectClass=nsPerson)(objectClass=posixAccount))", $baseDn);
        }
        $ldap->close();
    } else {
        echo "Failed to connect to LDAP server.n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "n";
}

if (isset($_POST['username']) && isset($_POST['password'])) {
    if ($ldapSession->authenticate($_POST['username'], $_POST['password'])) {
        header("Location: protected_page.php");
        exit();
    } else {
        echo "Invalid credentials.";
    }
}

if ($ldapSession->isLoggedIn()) {
    echo "Welcome, " . $_SESSION['ldap_username'] . "!";
} else {
    // Display login form
}
?>

How to change model to export from filament resource to exporter class

I have an application that uses filament 3.2 and in this application I have a resource called “Students”, within this resource I am calling a “TablesActionsExportBulkAction” that calls a custom exporter.

The problem is that my resource comes from the “Students” model and what I need to export is an entity called “Courses” which is another table and has a one to many relationship with students, so a course can have many students and a student can only belong to one course.

                TablesActionsExportBulkAction::make('export_courses')
                ->label('Courses export')
                ->icon('heroicon-o-document-arrow-down')
                ->color('success')
                ->modifyQueryUsing(function (Builder $query)
                {
                    $initalQuery = $query->pluck('id')->toArray();
                    $newQuery = Courses::query()
                        ->whereIn('student_id', $initalQuery)
                        ->with(['student', 'user']);
                    return $newQuery;
                })
                ->exporter(CoursesExporter::class),

But by default exporter takes the “Students” model that comes from the resource, and if I try to change it inside the exporter it doesn’t work:

protected static ?string $model = Courses::class;

I also tried to change the query inside the exporter using the “modifyQuery” method but it doesn’t work either, it gets an error when I try to export:

    public static function modifyQuery(Builder $query): Builder
{
    $initalQuery = $query->pluck('id')->toArray();
    $newQuery = Courses::query()
        ->whereIn('student_id', $initalQuery)
        ->with(['student', 'user']);
    return $newQuery;
}

Is there a way to do this natively with filament? Or maybe there’s a way to do this with a custom action or something?
I thank those who know and can respond!!

I’m using filament 3.2, php 8.2 and laravel 11.45.0