Why adding text in intervention/image text labels have too small size?

In laravel 10 app with intervention/image 3.4 I want to show some text with code :

$this->transformImageManager = new ImageManager(new Driver());
$image = $this->transformImageManager->read($this->sourceImagePath);

$image->text($label['text'], $x, $y, function ($font) use($size) {
    $font->filename('./fonts/DejaVuSans/DejaVuSans-Bold.ttf');
    $font->color('#ff0213');
    $font->align('center');
    $font->valign('top');
    $font->size(128);

But setting size 128 in the code above in rendered image has very small labels :

enter image description here

I have similar small text labels on any size value I pass,

also I set valid path to DejaVuSans-Bold.ttf file.

What is wrong and how to fix it ?

How do I get a Facebook user’s profile picture URL by user profile link?

I know that there is a logic to create a link to user profile image by using the user id. But I only have the link to the Facebook user profile not the Facebook user id.

I think maybe there need to be done getting the userid first and after that to create a link to user profile image by using that link logic.

i.e.
function getUserProfileImageURI(profileUri){

return FBUserProfileimgurl;
}

I need advice and guidance [closed]

I finished my web course in university last semester but I feel that I don’t have the sufficient knowledge to be web dev. and I’m depressed about that. I have learned some fundamental of web like protocols, HTML, PHP and a little CSS. I need someone to guidance me what I have to do next, I’m very good at basics and fundamental of web and the PHP, and we all know that the HTML don’t need anything.

Get some tips and guidance.

Sometimes form inserts data and other form comes empty, and don’t know of what it depends

I got a PHP file that processes a Post form, and sometimes it insert data correctly, and sometimes no data is inserted. I was trying different navigators and devices, and I still don’t understand what could be happening.

I show you my code:

include('procesar_database.php');

$nowDate = str_replace(" ", "", date('m/d/Y h:i:s a', time()));
$nowDate2 = preg_replace('/[^0-9]/', '', $nowDate);

$producto = '';
$origen = '';
$localizacion = '';
$humedad = 0.0;
$calidad = '';
$peso = 0;
$pacas = 0;
$fotomonton = '';
$fotomuestra = '';
$existsMonton = false;
$existsMuestra = false;

if (isset($_POST['producto'])){
    $producto = strval($_POST['producto']);
} 

if (isset($_POST['origen'])){
    $origen = strval($_POST['origen']);
} 

if (isset($_POST['localizacion'])){
    $localizacion = strval($_POST['localizacion']);
} 

if (isset($_POST['humedad'])){
    $humedad = floatval($_POST['humedad']);
} 

if (isset($_POST['calidad'])){
    $calidad = strval($_POST['calidad']);
} 

if (isset($_POST['peso'])){
    $peso = intval($_POST['peso']);
} 

if (isset($_POST['pacas'])){
    $pacas = intval($_POST['pacas']);
} 

if (ISSET($_FILES)){
    if (isset($_FILES['foto_monton'])){
        $fotomonton = $_FILES['foto_monton'];
        $existsMonton = true;
    } 

    if (isset($_FILES['foto_muestra'])){
        $fotomuestra = $_FILES['foto_muestra'];
        $existsMuestra = true;
    } 
}


if (isset($_POST['fotomonton']) && (empty($fotomonton))){
    $fotomonton = $_POST['fotomonton'];
    $existsMonton = true;
} 

if (isset($_POST['fotomuestra']) && (empty($fotomuestra))){
    $fotomuestra = $_POST['fotomuestra'];
    $existsMuestra = true;
} 

$ext_muestra = 'jpeg';
if (ISSET($_POST['extension_muestra'])){
    $ext_muestra = strval($_POST['extension_muestra']);
}

$ext_monton = 'jpeg';
if (ISSET($_POST['extension_monton'])){
    $ext_monton = strval($_POST['extension_monton']);
}

$uniquecode = uniqid();
if (ISSET($_POST['uniqueid'])){
    $uniquecode = strval($_POST['uniqueid']);
}

$pesoTotal = 0;

if ($pacas != null || $pacas > 0){
    $pesoTotal = intval($peso) * intval($pacas);
} else {
    $pesoTotal = intval($peso);
    $pacas = 1;
}


$urlfinal_monton = getURLMonton($fotomonton);
$urlfinal_muestra = getURLMuestra($fotomuestra);

$fecha = date('Y-m-d H:i:s');
$query = "INSERT INTO [dbo].[075_EntradasFabrica] (Producto, Origen, Localizacion, Humedad, PesoTotal, PesoPacas, NumeroPacas, Calidad, FotoMuestra, FotoMonton, IdCierre, createdAt) VALUES ('$producto','$origen', '$localizacion', '$humedad', '$pesoTotal', '$peso', '$pacas', '$calidad', '$urlfinal_muestra', '$urlfinal_monton', NULL, '$fecha')";
echo '<br />'.$query;


if (odbc_exec($connection, $query)){
    echo 'Datos incluídos en la base de datos correctamente.<br />';
} else {
    echo 'ERROR: Could not able to execute $query';
}

Then, I got this on database:

enter image description here

And I recieve this on test data:

enter image description here

I receive data sometimes, and other time don’t. What could it be?

I have tried bulk data insert, one by one, not parallel tests, on mobile and desktop, on Chrome, Firefox, Brave, Mi Navigator from Android and Edge. Still don’t understand.

Laravel When Condition on a column

I have a ModelA with columns: name, last_name, email

I want ModelA with the name Test to add an extra where on email

what I tried is the following

$model_a_res = A::when(
function($query){
    return $query->where('name','Test');
},
function ($query) { 
    $query->where('email', 'NOT LIKE', '%@test%');})
->first();

I want this second where to only run on A with column name = Test
however, this is not working.

I tried it with user name Mike and his email [email protected] and he didn’t appear in the result.

some data

id name email

1 Test [email protected] 
2 Test [email protected]
3 Mike [email protected]
4 Mike [email protected]

both 3 and 4 should be in the results
1 and 2 since they have name = Test will have another query which will check if he does have @test in his email if he does he will not be returned
returned Rows are 2, 3, 4

Laravel Socialite GitHub Authentication: Redirect Issue after Successful Authentication

I’m encountering an issue with GitHub authentication in my Laravel app using Laravel Socialite. Despite setting up everything correctly and being able to retrieve user data from GitHub, users aren’t redirected to the dashboard after logging in. I’ve checked my configuration files, but I can’t figure out what’s wrong.

I made sure my GitHub authentication was set up properly in Laravel Socialite, and I expected users to be redirected to the dashboard after logging in. However, despite successful authentication, users aren’t redirected as expected. Instead, they remain on the login page

OAuthController.php:

    public function redirect($github)
    {
        return Socialite::driver($github)
            ->setScopes(['read:user', 'public_repo'])
            ->redirect();
    }

    public function callback($github)
    {
        try {
            $socialUser = Socialite::driver($github)->user();

            $user = User::where([
                'github' => $github,
                'github_id' => $socialUser->id,
            ])->first();

            if (! $user) {
                $user = User::create([
                    'github_id' => $socialUser->id,
                ], [
                    'username' => $socialUser->getNickname(),
                    'name' => $socialUser->getName(),
                    'email' => $socialUser->getEmail(),
                    'github' => $socialUser->github,
                    'github_token' => $socialUser->token,
                ]);
            }

            Auth::attempt($user);

            return redirect()->intended(route('dashboard'));
        } catch (Exception $e) {
            return redirect()->route('login')->with('error', 'Something went wrong with ' . $github . ' login');
        }
    }

This resulted in Socialite actually fetching the data, but not doing anything with it. The config for this is correct, otherwise it would return a redirect_uri error, but this was not the case. Routing is fine too, socialite wouldn’t have been able to fetch otherwise. Which leads me to believe it has something to do with the Query Builder.

But despite my efforts, I’m unsure of what steps to take next. Any advice or suggestions on how to proceed would be greatly appreciated.

This is still my code, because I edited it. Is this correct php code to redirect data from a source in xml and convert it in json? [closed]

Question is that is this correct code for wordpress site? When I tried it as a plugin the code broke my site with “redirect err”. What might be the problem officer?

<?php
/*
Plugin Name: External API XML to JSON
Plugin URI: http://erikilonen.com/
Description: Fetch XML from an external API and convert it to JSON.
Version: 1.0
Author: Erik Ilonen
Author URI: http://erikilonen.com/
*/
 
add_action('rest_api_init', function () {
    register_rest_route('external-api/v1', '/test/', array(
        'methods' => 'GET',
        'callback' => 'fetch_external_api_data',
    ));
});
 
function fetch_external_api_data(WP_REST_Request $request) {
    // Replace 'external_api_url' with the actual URL of the external API
    $response = wp_remote_get('https://web-api.tp.entsoe.eu/api?securityToken=MY_TOKEN&documentType=A44&processType=A16&outBiddingZone_Domain=10YFI-1--------U&In_Domain=10YFI-1--------U&Out_Domain=10YFI-1--------U&periodStart=202403040800&periodEnd=202403040900');
 
    if (is_wp_error($response)) {
        return new WP_Error('fetch_error', 'Error fetching external API data', array('status' => 500));
    }
 
    $body = wp_remote_retrieve_body($response);
    $xml = simplexml_load_string($body);
    $json = json_encode($xml);
    $data = json_decode($json, true); // Convert to associative array
 
    return new WP_REST_Response($data, 200);
}
 ?>

Codeigniter callback didn’t get the response

Hi i’m new at the codeigniter. I’m trying to intigrate some payment gateway to an site. I send my callback url to my provider as http://myurl.com/Callbacka and they declared. So,i trigger the send_post_request function call the url http://myurl.com/Callbacka/send_post_requestin browser but nothing happen.I can’t figure out what i’m missing..Thanks for any help.

<?php
class Callbacka extends controller {

    function __construct() {
        parent::controller();
        $this->admin = $this->load->model("admin");
        $this->user = $this->load->library("user");
        $this->cookie = $this->load->library("cookie");

    }

    /*public function index($id) {    //
        $requestData = json_decode(file_get_contents('php://input'), true);
        $responseDatas = json_decode($requestData, true);
        echo $responseDatas;
        
}*/

    public function send_post_request() {
        // Data to be sent in the POST request
        $post_data = array(
            'sid' => '9980',
            'key' => 'nSW45i395Sx2SP998XB6p410W7wX43tf8n6a6Y5slKkM1z2D0UyGxd5eh7ucJ_bAZ8j'
            // Add any other data you need to send
        );

      
        // Initialize cURL session
        $ch = curl_init();

        // Set cURL options
        curl_setopt($ch, CURLOPT_URL, 'https://api.serviceprovider.com/BankList/');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

        // Execute the cURL session
        $response = curl_exec($ch);

        // Close the cURL session
        curl_close($ch);

        //$responseData = json_decode($response, true);
        //echo $responseData;
        // Process the response as needed
        // For example, you can pass the response to the callback function
        $this->handle_callback($response);
        
    }

    // Callback function to handle the response from the other site
     public function handle_callback($response) {
        // Handle the response data received from the other site
        // For example, you can echo the response
        
         echo $response;

        $this->db->query("UPDATE admin SET name = $response_data WHERE username = 'demone'");
        // You can perform any necessary actions on the response from the other site
    }
    
}

 



?>

What are the free online coding class courses? [closed]

I am looking for a medium of online IT/software training from where I can study all the courses regarding IT step by step for free. I can also practice coding.

Web design is basic for me, I started taking information from HTML, through online we started taking information from stack overflow, quora and codelines tutorials. I want ideas which is the best platform for online IT training.

laravel broadcast.php pusher option not working

I am working on a realtime chatting application and I am using websocket with laravel

I am using library beyoundcode/laravel-websocket

I have change broadcast driver to pusher and have configured broadcaster.php to this

    'connections' => [

        'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER'),
                'host' => '127.0.0.1',
                'port' => env('PUSHER_PORT', 6001),
                'scheme' => env('PUSHER_SCHEME', 'http'),
                'encrypted' => true,
            ],
            'client_options' => [
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
            ],
        ],

When I run an event using

event(new AppEventsUserStatusEvent())  

Instead of sending message to localhost which is 127.0.0.1 stated in pusher option it sends to pusher.com

I clear clear my cache and config not changes

class UserStatusEvent implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public function __construct()
    {
        //
    }

    public function broadcastOn()
    {
        return new PresenceChannel('status-update');
    }
}

calculate the average of a nested collection

I do have a collection and I want to do either one of the following: the sum or the average of a property in specific relation in that collection so for example I want to get the average from the total property in the following relation orders.invoice
so in the code I have to loop on all the orders (as the orders here are an array) and then go to each invoice (as the order here has one invoice) in each order and then calculate the average. so if we have 3 orders and those orders has an invoice with those values (in the total property) 50, 200 and 100, the return value will be (50 + 200 + 100) / 3 = 116.7 if we are doing an average if we are doing sum it would be 50 + 200 + 100 = 350

note that the collection could be nested and we don’t know the type of the relation between the nested relations ex: “relation1.relation2.relatoin3” so if relation 1 is a collection we will need to loop on it and if relation2 is an object we just go directly to the next relation.

so far I have managed to do the sum but what’s left is the average, here is the function:

 /**
 * calculate the sum/AVG based on the chosen property on a single relation or nested relations.
 * 
 * @var IlluminateSupportCollection | array $entity
 * @var string $path
 * @var string $property
 * @var 'sum'|'avg' $operation
 * @return float
 */
public static function compute($entity, string $path, string $property, string $operation = 'sum'): float
{
    $parts    = explode('.', $path, 2); // Limit to 2 parts
    $relation = $parts[0];
    $new_path = isset($parts[1]) ? $parts[1] : '';
    $result   = 0;
    $count    = 0;

    if (is_iterable($entity)) {
        $entity->each(function ($item) use (&$result, &$count, $path, $property, $operation) {
            $result += self::compute($item, $path, $property, $operation);
            $count++;
        });

        return $result;
    }
    
    if (is_iterable($entity->{$relation})) {
        collect($entity->{$relation})->each(function ($item) use (&$result, &$count, $new_path, $property, $operation) {
            if($new_path == '') {
                $result += $item->{$property};
                $count++;
            } else {
                $result += self::compute($item, $new_path, $property, $operation);
            }
        });
    } else if($entity->{$relation}) {
        if($new_path == '') {
            $result += $entity->{$relation}->{$property};
            $count++;
        } else {
            $result += self::compute($entity->{$relation}, $new_path, $property, $operation);
        }
    }

    if($operation == 'avg' && $count > 0) {
        // dd($count);
        $result /= 4; // here is the problem in the `avg` as we can't save the value of the $count on every function call as we do with $result 
    }

    return $result;
}

here is the test:

<?php

namespace TestsUnit;

use TestsTestCase;
use IlluminateSupportFacadesFile;
use AppCollectionNestedCollection;

class CollectionNestedComputationTest extends TestCase {
protected $data;

protected function setup(): void
{
    parent::setup();
    $this->data = collect(json_decode(file_get_contents(base_path('tests/Unit/data.json')))->results);
}

/**
 * single path.
 */
public function test_that_single_path_is_calculated_correctly(): void
{
    $path = 'devis';
    $property = 'id';

    $this->assertEquals(292763, NestedCollection::compute($this->data, $path, $property, 'sum'));
    $this->assertEquals(73190.75, NestedCollection::compute($this->data, $path, $property, 'avg'));
}

/**
 * nested path.
 */
public function test_that_nested_path_is_calculated_correctly(): void
{
    $path = 'devis.data.trajets.brands';
    $property = '1';

    $this->assertEquals(1940, NestedCollection::compute($this->data, $path, $property, 'sum'));
    $this->assertEquals(485, NestedCollection::compute($this->data, $path, $property, 'avg'));
}

}

and here is the data used in the test:

{
"results": [
{
    "id": 10575,
    "devis": {
        "id": 73258,
        "data": {
            "trajets": [
                {
                    "brands": {
                        "1": -990
                    }
                }
            ]
        }
    }
},
{
    "id": 10574,
    "devis": {
        "id": 73235,
        "data": {
            "trajets": [
                {
                    "brands": {
                        "1": "990"
                    }
                }
            ]
        }
    }
},
{
    "id": 10573,
    "devis": {
        "id": 73143,
        "data": {
            "trajets": [
                {
                    "brands": {
                        "1": "1250"
                    }
                }
            ]
        }
    }
},
{
    "id": 10572,
    "devis": {
        "id": 73127,
        "data": {
            "trajets": [
                {
                    "brands": {
                        "1": "690"
                    }
                }
            ]
         }
    }
}
]

}

as I mentioned above the sum works as excepted but the average is not working as expected

Download catelog when we click on button? [closed]

I create one model on that I created form on customer feel there data the will save on database then user can get download get catelog. if user not fill data then it can’t download the catelog.

I create mysql database on that databases save data is successfully saved in databases. but but catelog pdf is not downloaded. How we can slove this error.

Symfony 6, not able to read legacy session

I have a legacy API application which makes traditional session_start(); and fills data into $_SESSION.
Now I am doing a v2 API with Symfony 6.4, in the same environment, and I want to read data form $_SESSION.

I found Integrating with Legacy Applications.
I don’t know if the legacy application has a mentioned own PHP save handler, I just tried all possible configuration combinations.

framework:
    session:
        storage_factory_id: session.storage.factory.php_bridge

I removed the var/cache & warmed it up.

Result:

  • $_SESSION: undefined
  • $this->requestStack->getSession(): Gives a complicated object tree, without legacy session data, but weird Symfony keys with empty arrays _sf2_attributes, _symfony_flashes.
  • $this->requestStack->getSession()->get('keyInLegacySession'): null
framework:
    session:
        storage_factory_id: session.storage.factory.php_bridge
        handler_id: ~

I removed the var/cache & warmed it up.

Result: Same as above.

framework:
    session:
        storage_factory_id: session.storage.factory.php_bridge
        handler_id: session.handler.native_file

I removed the var/cache & warmed it up.

Result: Same as above.

I tried to debug as explained in https://stackoverflow.com/a/44145831/4840661, bug legacy and Symfony give the same ini settings.

Any ideas how to read legacy session data in my case with Symfony?

Installation failed while try to install slim framework

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

Problem 1
– slim/psr7[0.1.0, …, 0.6] require php ^7.1 -> your php version (8.0.30) does not satisfy that requirement.
– slim/psr7[1.0.0, …, 1.2.0] require php ^7.2 -> your php version (8.0.30) does not satisfy that requirement.
– slim/psr7[1.3.0, …, 1.6.1] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
– Root composer.json requires slim/psr7 * -> satisfiable by slim/psr7[0.1.0, …, 0.6, 1.0.0, …, 1.6.1].

Use the option –with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. “composer require slim/psr7:*” to figure out if any version is installable, or “composer require slim/psr7:^2.1” if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
it happen when i type “composer require slim/psr7” in cmd vs code terminal .

Laravel routes returning CORS errors after upgrading PHP version from 7.3 to 7.4

I have a Laravel backend providing an API to my Angular frontend. As a local environment I use Vagrant with Laravel Homestead. My Laravel version is 8 (8.83.27). Everything is working just fine.

But when I try to upgrade PHP version (to 7.4 or 8.0) by editing my composer.json and running “composer update”, I’m in trouble. All my API routes start responding with CORS errors, and preflight requests respond with 502. If I revert the changes and run “composer update” again with the previous configuration, it works correctly, as it used to. I’m not sure if this is about the environment, some configurations, or the dependencies. Any help on this one?

This is my composer.json before editing. Works as it is, but leading to CORS errors after upgrading PHP and running composer update.

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.3|^8.0",
        "doctrine/dbal": "^3.3",
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.19",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^8.0",
        "laravel/legacy-factories": "^1.1",
        "laravel/passport": "^10.2",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^3.0",
        "mxl/laravel-job": "^1.2",
        "nesbot/carbon": "^2.0.0",
        "nunomaduro/collision": "^5.3",
        "symfony/http-client": "^5.4",
        "symfony/mailgun-mailer": "^5.4"
    },
    "require-dev": {
        "composer/composer": "^2.2",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "^9.3"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r "file_exists('.env') || copy('.env.example', '.env');""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\Foundation\ComposerScripts::postInstall"
        ],
        "post-update-cmd": [
            "Illuminate\Foundation\ComposerScripts::postUpdate"

        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "platform": {
            "php": "7.3"
        }
    }
}

I tried to change the following

“require”: { “php”: “^7.3|^8.0”, => “php”: “^7.4|^8.0”,

and

“platform”: { “php”: “7.3” => “php”: “7.3”

Which lead to the following package updates:

Updating dependencies
Lock file operations: 5 installs, 13 updates, 0 removals
  - Upgrading carbonphp/carbon-doctrine-types (1.0.0 => 2.1.0)
  - Upgrading composer/pcre (2.1.1 => 3.1.1)
  - Locking dflydev/dot-access-data (v3.0.2)
  - Upgrading doctrine/dbal (3.3.8 => 3.8.3)
  - Upgrading fakerphp/faker (v1.20.0 => v1.23.1)
  - Upgrading firebase/php-jwt (v6.4.0 => v6.10.0)
  - Locking lcobucci/clock (2.0.0)
  - Upgrading lcobucci/jwt (3.4.6 => 4.3.0)
  - Upgrading league/commonmark (1.6.7 => 2.4.2)
  - Locking league/config (v1.2.0)
  - Upgrading league/mime-type-detection (1.12.0 => 1.15.0)
  - Upgrading league/uri (6.5.0 => 6.7.2)
  - Locking nette/schema (v1.2.5)
  - Locking nette/utils (v3.2.10)
  - Upgrading nikic/php-parser (v4.18.0 => v5.0.2)
  - Upgrading psr/container (1.1.1 => 1.1.2)
  - Upgrading psy/psysh (v0.11.22 => v0.12.0)
  - Upgrading ramsey/collection (1.2.2 => 1.3.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 5 installs, 13 updates, 0 removals
  - Downloading nikic/php-parser (v5.0.2)
  - Upgrading psr/container (1.1.1 => 1.1.2): Extracting archive
  - Upgrading composer/pcre (2.1.1 => 3.1.1): Extracting archive
  - Upgrading doctrine/dbal (3.3.8 => 3.8.3): Extracting archive
  - Upgrading ramsey/collection (1.2.2 => 1.3.0): Extracting archive
  - Upgrading carbonphp/carbon-doctrine-types (1.0.0 => 2.1.0): Extracting archive
  - Upgrading league/mime-type-detection (1.12.0 => 1.15.0): Extracting archive
  - Installing nette/utils (v3.2.10): Extracting archive
  - Installing nette/schema (v1.2.5): Extracting archive
  - Installing dflydev/dot-access-data (v3.0.2): Extracting archive
  - Installing league/config (v1.2.0): Extracting archive
  - Upgrading league/commonmark (1.6.7 => 2.4.2): Extracting archive
  - Upgrading fakerphp/faker (v1.20.0 => v1.23.1): Extracting archive
  - Upgrading league/uri (6.5.0 => 6.7.2): Extracting archive
  - Installing lcobucci/clock (2.0.0): Extracting archive
  - Upgrading lcobucci/jwt (3.4.6 => 4.3.0): Extracting archive
  - Upgrading firebase/php-jwt (v6.4.0 => v6.10.0): Extracting archive
  - Upgrading nikic/php-parser (v4.18.0 => v5.0.2): Extracting archive
  - Upgrading psy/psysh (v0.11.22 => v0.12.0): Extracting archive

I tried to upgrade my PHP version by editing composer.json and running composer update. The upgrade itself goes ok but all routes start responding with CORS errors, and preflight with 502.