Found 43 issues

First time here? 👋

Welcome to Find a PR.

Find a PR is an open-source site that is built to help developers find projects so that they can submit their very first pull request.

If you're a contributor looking to find a project to contribute to, feel free to browse through the list below.

If you're a maintainer looking to list your project on Find a PR, you can read how to do this in the documentation.

bug help wanted

Laravel Version

10.x and 11.x

PHP Version

8.1, 8.2 and 8.3

Database Driver & Version

No response

Description

Description of the Issue

When a Bus::chain contains a job with a readonly promoted non-scalar property, only the first job or batch in the chain is executed. The subsequent jobs or batches appear to be discarded. Additionally, even if the chain is dispatched on a non-default queue, the jobs still run on the default queue.

No exceptions were found in the logs.

Environment

Laravel versions: 10.x and 11.x PHP versions: 8.1, 8.2, and 8.3

Evidence

Failing test PR : #51878 A repository that reproduces the problem can be found here: https://github.com/shaffe-fr/framework/commit/f1b3cad6d6e3a78d108f25d751d144049e070626

Here is a screenshot illustrating the issue: image

Steps To Reproduce

  1. Create a Bus::chain with at least one job having a readonly promoted non-scalar property.
  2. Dispatch the chain.
  3. Observe that only the first job or batch is executed, and subsequent jobs/batches are not processed.
  4. Note that jobs run on the default queue, regardless of the specified queue.
View more
3 comments 👍 1
shaffe-fr

shaffe-fr

21st Jun 2024 @ 13:40

help wanted findapr

Flash messages are being stored in the session but are not showing up on the screen. They keep getting added with each request. The messages are not being rendered to the user.

View more
1 comment
codebyshami

codebyshami

28th Jun 2024 @ 18:29

help wanted

Hello,

I noticed that there is an incompatibility with the mbstring polyfill and PHP 8.1 / Alpine Linux, which breaks a lot of my projects as soon as the php81-mbstring is not installed, but php81-iconv is installed:

Example:

Warning: iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed in phar:///var/www/localhost/htdocs/phpstan.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 736

It looks like //IGNORE is not accepted since echo iconv('UTF-8', 'UTF-8', 'test'); works, while echo iconv('UTF-8', 'UTF-8//IGNORE', 'test'); doesn't

View more
2 comments 👍 1
danielmarschall

danielmarschall

7th Jan 2022 @ 00:12

enhancement help wanted
View more
driesvints

driesvints

12th Mar 2024 @ 10:20

help wanted findapr
  public function bell()
    {
        $this->count += 1;
        flash()->addInfo('Your information has been saved and a confirmation email has been sent.');
    }

This flash message doesn't show up until I reload the page If I reload the page then what's is the point of using livewire

View more
12 comments 👍 1
codebyshami

codebyshami

17th Nov 2023 @ 01:19

help wanted

When encountering nested tokens, they are parsed only during formatting, not when compiling the pattern. And the type of tokens are validated only during the rendering as well. But the native implementation detects such error during the instantiation: https://3v4l.org/Sf69D This means that the error handling required for the polyfill is not the same than for the native implementation.

View more
stof

stof

23rd Oct 2018 @ 15:58

help wanted

Laravel Version

10.x

PHP Version

8.3

Database Driver & Version

No response

Description

Hello,

I would like to report that seems to me an issue when passing value to a class castable attribute.

Let's say a model has an Enum Collection attribute countries:

$casts = ['countries' => AsEnumCollection::class.':'.Country::class];

After fetching the model, we can have something like : countries: ['FRA', 'USA']

But if we want to manually use the castAttribute method with a custom value the result will always be the same as fetched before:

$value = ['FRA', 'USA', 'JPN'];
$result = $model->castAttribute('countries', $value);

// $result: ['FRA', 'USA']

Shouldn't we get our passing value as a result?

In the https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Eloquent/Casts/AsEnumCollection.php#L31, the $value argument is never used, shouldn't be used if passed to the method? Is it by design? The same thing can be observed on the other casting classes.

Thank you!

Steps To Reproduce

Pass a custom value to model's method castAttribute, result will always be the data retrieved before:

$value = ['FRA', 'USA', 'JPN'];
$result = $model->castAttribute('countries', $value);

// $result: ['FRA', 'USA']
View more
6 comments
BenjaminMINK

BenjaminMINK

28th Jun 2024 @ 09:24

help wanted

When calling mb_convert_encoding() with $fromEncoding === 'HTML-ENTITIES', the polyfill does not return functionally equivalent strings to the native function. This is because mb_convert_encoding() uses html_entity_decode() when $fromEncoding === 'HTML-ENTITIES' and that function does not return characters for many numeric entities 0-31 and 127-159. For example:

<?php

require "vendor/symfony/polyfill-mbstring/Mbstring.php";

use Symfony\Polyfill\Mbstring as p;

for($i = 0; $i < 1024; $i++) {
	$string = "&#" . $i . ";";
	$mbstring = mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
	$polyfill = p\Mbstring::mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
	if($mbstring != $polyfill) {
		echo "Mismatch: $string - mbstring: $mbstring; polyfill: $polyfill\n";
	}
}

outputs:

Mismatch: &#0; - mbstring: ; polyfill: &#0;
Mismatch: &#1; - mbstring: ; polyfill: &#1;
Mismatch: &#2; - mbstring: ; polyfill: &#2;
Mismatch: &#3; - mbstring: ; polyfill: &#3;
Mismatch: &#4; - mbstring: ; polyfill: &#4;
Mismatch: &#5; - mbstring: ; polyfill: &#5;
Mismatch: &#6; - mbstring: ; polyfill: &#6;
Mismatch: &#7; - mbstring: ; polyfill: &#7;
Mismatch: &#8; - mbstring:; polyfill: &#8;
Mismatch: &#11; - mbstring:
                            ; polyfill: &#11;
Mismatch: &#12; - mbstring:
                            ; polyfill: &#12;
Mismatch: &#14; - mbstring: ; polyfill: &#14;
Mismatch: &#15; - mbstring: ; polyfill: &#15;
Mismatch: &#16; - mbstring: ; polyfill: &#16;
Mismatch: &#17; - mbstring: ; polyfill: &#17;
Mismatch: &#18; - mbstring: ; polyfill: &#18;
Mismatch: &#19; - mbstring: ; polyfill: &#19;
Mismatch: &#20; - mbstring: ; polyfill: &#20;
Mismatch: &#21; - mbstring: ; polyfill: &#21;
Mismatch: &#22; - mbstring: ; polyfill: &#22;
Mismatch: &#23; - mbstring: ; polyfill: &#23;
Mismatch: &#24; - mbstring: ; polyfill: &#24;
Mismatch: &#25; - mbstring: ; polyfill: &#25;
Mismatch: &#26; - mbstring: ; polyfill: &#26;
Mismatch: &#27; - mbstring:  polyfill: &#27;
Mismatch: &#28; - mbstring: ; polyfill: &#28;
Mismatch: &#29; - mbstring: ; polyfill: &#29;
Mismatch: &#30; - mbstring: ; polyfill: &#30;
Mismatch: &#31; - mbstring: ; polyfill: &#31;
Mismatch: &#39; - mbstring: '; polyfill: &#39;
Mismatch: &#127; - mbstring: ; polyfill: &#127;
Mismatch: &#128; - mbstring: €; polyfill: &#128;
Mismatch: &#129; - mbstring: ; polyfill: &#129;
Mismatch: &#130; - mbstring: ‚; polyfill: &#130;
Mismatch: &#131; - mbstring: ƒ; polyfill: &#131;
Mismatch: &#132; - mbstring: „; polyfill: &#132;
Mismatch: &#133; - mbstring: …; polyfill: &#133;
Mismatch: &#134; - mbstring: †; polyfill: &#134;
Mismatch: &#135; - mbstring: ‡; polyfill: &#135;
Mismatch: &#136; - mbstring: ˆ; polyfill: &#136;
Mismatch: &#137; - mbstring: ‰; polyfill: &#137;
Mismatch: &#138; - mbstring: Š; polyfill: &#138;
Mismatch: &#139; - mbstring: ‹; polyfill: &#139;
Mismatch: &#140; - mbstring: Œ; polyfill: &#140;
Mismatch: &#141; - mbstring: ; polyfill: &#141;
Mismatch: &#142; - mbstring: Ž; polyfill: &#142;
Mismatch: &#143; - mbstring: ; polyfill: &#143;
Mismatch: &#144; - mbstring: ; polyfill: &#144;
Mismatch: &#145; - mbstring: ‘; polyfill: &#145;
Mismatch: &#146; - mbstring: ’; polyfill: &#146;
Mismatch: &#147; - mbstring: “; polyfill: &#147;
Mismatch: &#148; - mbstring: ”; polyfill: &#148;
Mismatch: &#149; - mbstring: •; polyfill: &#149;
Mismatch: &#150; - mbstring: –; polyfill: &#150;
Mismatch: &#151; - mbstring: —; polyfill: &#151;
Mismatch: &#152; - mbstring: ˜; polyfill: &#152;
Mismatch: &#153; - mbstring: ™; polyfill: &#153;
Mismatch: &#154; - mbstring: š; polyfill: &#154;
Mismatch: &#155; - mbstring: ›; polyfill: &#155;
Mismatch: &#156; - mbstring: œ; polyfill: &#156;
Mismatch: &#157; - mbstring: ; polyfill: &#157;
Mismatch: &#158; - mbstring: ž; polyfill: &#158;
Mismatch: &#159; - mbstring: Ÿ; polyfill: &#159;

While many of these are control characters (and the native function does return them), the single quote (dec 39) is particularly problematic.

View more
1 comment
cpeel

cpeel

18th Mar 2021 @ 04:11

enhancement help wanted

Discussed in https://github.com/spatie/schema-org/discussions/202

Originally posted by indyjonesnl January 10, 2024

$lodgingBusiness = Schema::lodgingBusiness()
  ->openingHours(
    Schema::openingHoursSpecification()
      ->dayOfWeek([Schema::dayOfWeek()::Monday])
      ->opens(new DateTime('09:00:00'))
      ->closes(new DateTime('17:00:00'))
  )
  ->checkinTime(new DateTime('14:00:00'))
  ->checkoutTime(new DateTime('11:00:00'))

This results in the current date + time being included in the output "opens":"2024-01-10T09:00:00+00:00","closes":"2024-01-10T17:00:00+00:00" and ..."checkinTime":"2024-01-10T14:00:00+00:00","checkoutTime":"2024-01-10T11:00:00+00:00"...

While the Schema should contain only the time, formatted as 14:30:00+08:00.

Can someone point me in the right direction?

View more
Gummibeer

Gummibeer

11th Jan 2024 @ 13:12

enhancement help wanted hacktoberfest

Found the \Illuminate\Database\Eloquent\Concerns\HasAttributes::originalIsEquivalent() method during code diving and it should be usable for our trait! 🎉 This PR would be mainly reasearch when that method was added, if it's compatible with our version support rules and switching our own change detection logic with the core one.

View more
3 comments
Gummibeer

Gummibeer

20th Oct 2021 @ 10:03

help wanted findapr

I'm using Laravel 10. I've installed the package via "composer require php-flasher/flasher-laravel" Now I'm able to fire flash messages in my controller. I see them in the session data (in flasher::envelopes). But they aren't showing up in my views. In my config file I have 'auto_render' => true. If I put @flasher_render in my blade view, the only thing that's happens is, a notification to warn that this method wil be deprecated.

How can I fix this? I really like to use this package ;-)

View more
5 comments
krisc78

krisc78

9th Mar 2023 @ 14:49

help wanted findapr

Hi,

I have an issue in my dockerized Laravel 10 app and flasher 1.15.3. The issue is that notifications are not displayed when I'm using something like this:

    public function customRoute(Request $request): RedirectResponse
    {
        // action
        flash()->addSuccess('Success notification.');

        return redirect()->back();
    }

When I'm redirecting notification won't be displayed, but when directly returning view it works. It behaves like that because of this part of code in your package:

final class StorageBag implements StorageInterface
{
    /**
     * @var BagInterface
     */
    private $bag;

    public function __construct(BagInterface $bag = null)
    {
        $this->bag = null !== $bag && 'cli' !== \PHP_SAPI ? $bag : new ArrayBag();
    }

especially this 'cli' !== \PHP_SAPI because since we are using docker our app is in CLI mode. Can anoyone tell my why this PHP_SAPI check has to be present here?

View more
forexknight

forexknight

13th Sep 2023 @ 05:19

help wanted

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I have checked that the bug-fix I am reporting can be replicated.

Description of the problem

One of the important reasons for using hyperscript is that it handles escaping of characters which are reserved in html. Which prevents XSS.

spatie/html-element does not do this. Mainly because it uses strings as intermediate format instead of an object representation of the DOM.

View more
6 comments 👍 3
Erikvv

Erikvv

1st Feb 2018 @ 02:19

help wanted findapr

Laravel : phpflasher I am using https://php-flasher.io/ for flash notification in laravel project. and for add product to cart i am sending the falsh to show successful message it works fine it shows up the flash notification error : But teh flash Toast comes back if you navigate away and return back to the page again is there any solution there. image

image

View more
6 comments
sanzgrapher

sanzgrapher

3rd Jul 2024 @ 06:24

help wanted

Add in PHP 7.3 as Normalizer::normalize() argument for NFKC_Casefold normalization.

View more
1 comment
nicolas-grekas

nicolas-grekas

7th Feb 2019 @ 10:11

help wanted

I would be good to support normalizer_get_raw_decomposition function that appeared in PHP 7.3. I've tried to implement it but seems that existing decomposition data is already optimized to get the final decomposition. Example test case is available here. Pinging @nicolas-grekas as he is the author of Normalizer polyfill.

View more
4 comments
IonBazan

IonBazan

12th May 2018 @ 23:26

bug help wanted

When attempting to filter tests by test or file name pressing the "Enter" key has no effect.

Pressing "Enter" at the default screen correctly triggers a "test run" where all tests are run.

View more
4 comments
ntwb

ntwb

25th Feb 2018 @ 10:49

help wanted

Hi,

With the polyfill, var_dump(mb_strlen(chr(254))) return 0. With the php8.0-mbstring extension, var_dump(mb_strlen(chr(254))) return 1;

versions : * v1.26.0

Thanks, Alex

View more
7 comments
alexchuin

alexchuin

18th Oct 2022 @ 12:51

bug confirmed low priority help wanted

Package

filament/filament

Package Version

v3.2.92

Laravel Version

v11.14.0

Livewire Version

v3.5.2

PHP Version

PHP 8.2.21

Problem description

When using stat widgets, the chart color will load fine on a hard reload but when you resize the browser window, will randomly flip between colors.

WqE9mpX

f1IyqJJ

I tested in both Chrome and Safari so I don't think it's a browser issue.

More discussion here: https://github.com/filamentphp/filament/discussions/10637

Edit: They also appear to change color with sidebar collapse and also polling updates.

Expected behavior

Stay the original color.

Steps to reproduce

Open demo app dashboard and resize browser. Observe stat widget chart colors change.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/filamentphp/demo

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
View more
1 comment 👍 1
ryanmortier

ryanmortier

9th Jul 2024 @ 19:11

help wanted findapr

I found some issues after the version 2 upgrade on Laravel 11:

  • Config inject_assets doesn't affect the rendering.
  • Config timeout is no longer working and I have to set it for every request
  • The option for replacing Laravel default flash is removed, and can't be changed unlike version 1, while the only way to skip this is by using other flash names except (success, error, warning, and info) which means changing a lot of code for existing apps.
  • Changing flash_bag in the config doesn't override the default bags but adds new values to the default array.
  • When using the Laravel default flash with the bags (success, error, warning, info) the php-flasher fires after reloading the page (after the flash expires).

If version 2 main concept is to replace the default Laravel flash without an option to disable it, I know that downgrading should be the proper solution but unfortunately, this also will not be a good solution because version 1 with Laravel 11 disables the default flash option entirely and also have to rewrite a lot of code to change it to php-flasher and that why I upgraded to version 2 in the first place.

View more
4 comments ❤️ 1
AhmedGamal

AhmedGamal

22nd May 2024 @ 19:31

help wanted

Laravel Version

10.48.12 (although I believe relevant code has not changed in 11.x)

PHP Version

8.1.28

Database Driver & Version

Redis 7.2.5 (although issue should exist with other cache drivers)

Description

When dispatching jobs, the ShouldBeUnique behavior is only respected when dispatching through the PendingDispatch class and the Illuminate\Console\Scheduling\Schedule class (the latter fix was added in #39302). However, it is not respected when using the Illuminate\Bus\Dispatcher class or individual queue drivers (Queue::push( ... ), etc). This behavior can be confusing because depending on how you queue the job, it's easily possible to queue duplicates, despite the job implementing ShouldBeUnique

I found a previous PR (#50381) that attempted to move the ShouldBeUnique check into the Dispatcher class. Although that still wouldn't guarantee uniqueness when using Queue::push(). I was also able to find some other issues which seem to indicate that people are generally expecting ShouldBeUnique to work universally:

  • #39113
  • #45781
  • #42297
  • #48882

There's also a mention in the original PR for the ShouldBeUnique feature mentioning how this could possibly be moved into the enqueueUsing() logic in the Queue class? This seems like it would probably fix all of the above issues

Further, the Dispatcher class and Queue enqueueUsing() method already check other "expressive" interfaces like ShouldQueue, ShouldQueueAfterCommit, etc, so it seems reasonable to also check ShouldBeUnique there

I would be willing to open a PR for this if desired. Was hesitant to do so as a similar PR (#50381) has already been closed

Steps To Reproduce

Create a job which implements ShouldBeUnique

<?php

namespace App\Jobs;

use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class UniqueJob implements ShouldQueue, ShouldBeUnique
{
    use Dispatchable;

    ...
}

Confirm that ShouldBeUnique works correctly when using PendingDispatch. In tinker

Queue::size(); // Returns 0
UniqueJob::dispatch();
Queue::size(); // Returns 1. May have to call this multiple times, presumably to trigger the `__destruct()` method in `PendingDispatch`, but it will queue the job eventually
UniqueJob::dispatch();
Queue::size(); // Still returns 1, as `ShouldBeUnique` prevents queuing

Confirm that using Queue::push(new UniqueJob()), app(Dispatcher::class)->dispatch(new UniqueJob()), Bus::dispatch(new UniqueJob()) do not work the same way

Queue::size(); // Returns 0
Queue::push(new UniqueJob());
Queue::size(); // Returns 1
Queue::push(new UniqueJob());
Queue::size(); // Returns 2. One would expect a "unique" job to not be queued again
View more
1 comment 👍 3
kellerjmrtn

kellerjmrtn

13th Jun 2024 @ 20:01

enhancement help wanted

Hi! If I use this package with my project I has a problem. My package.json has a "git dependency" like this:

{
  "peerDependencies": {
    "package": "git+ssh://git@bitbucket.org/team/project.git"
  }
}

And npm-install-peers breaks.

View more
👍 5
JWo1F

JWo1F

18th Dec 2017 @ 08:52

help wanted

NotOrm Package

The goal is to make abstract code based on the package notorm to build a new orm system

View more
ambroisehdn

ambroisehdn

15th Jun 2022 @ 12:34

enhancement help wanted hacktoberfest

Describe the bug I have a table which has an order column. When I reorder the elements I update each model with the new order. Because the table has some large JSON columns I select only id and order columns for efficiency. I set the new order and save the model.

foreach (Faq::query()->get(['id', 'order']) as $faq) {
    $faq->order = $newOrder[$faq->id];
    $faq->save();
}

The diffs created in the activity_log table look like this:

{
   "old": {
      "order": 1,
      "answer": null,
      "question": null
   },
   "attributes": {
      "order": 2,
      "answer": "long JSON content",
      "question": "long JSON content"
   }
}

From what I see laravel-activitylog fetches the model with all columns from the database before creating a log entry which kind of defeats the purpose of my "select list optimization" and produces an incorrect diff.

Generally I want these large JSON columns to be logged in case a user changes them but in this case I only change the order column so I would like to see only the order column in the diff.

I have tried running these updates straight off the Eloquent builder:

Faq::query()->where('id', $id)->update(['order' => $newOrder[$id]]);

but in this case nothing is logged.

I have the following activitylog configuration for my models:

public function getActivitylogOptions(): LogOptions
{
    return LogOptions::defaults()
                     ->logAll()
                     ->logOnlyDirty()
                     ->logExcept([
                         'id',
                         'created_at',
                         'updated_at',
                     ]);
}

To Reproduce Select a subset of columns from the database, change these columns, save the model and see that other (not initially selected) columns are present in the diff.

Expected behavior Only columns that've actually been changed should be present in the diff.

Versions

  • PHP: 8.1
  • Database: MySQL 8
  • Laravel: 9.31.0
  • Package: 4.6.0
View more
5 comments
KKSzymanowski

KKSzymanowski

28th Sep 2022 @ 21:53

enhancement help wanted

For some reason, our test suite is super slow. We should look into this and try to decrease memory usage and speed it up.

Parallel run:

  Tests:    316 passed (785 assertions)
  Duration: 13.64s
  Parallel: 10 processes

Regular run:

  Tests:    316 passed (785 assertions)
  Duration: 96.30s
View more
driesvints

driesvints

29th Dec 2023 @ 10:43

bug help wanted

What happened?

After installation, I noticed that in the browser console it outputs an error of wireEl is undefined.

How to reproduce the bug

Just install this package in a livewire project, preferable with Filament's admin package. And see the browser console.

composer create-project laravel/laravel test;
composer require filamentphp/filament;
composer require spatie/laravel-blade-comments;

Then go through the browser console and see the error

Package Version

1.0.1

PHP Version

8.2.0

Laravel Version

10.13.0

Which operating systems does with happen with?

macOS

Notes

Filament ......................................................
Packages ...... filament, forms, notifications, support, tables
Version .............................................. v2.17.44
Views ..................................... PUBLISHED: filament

View more
4 comments 👍 1
sawirricardo

sawirricardo

2nd Jun 2023 @ 07:15

help wanted

Octane Version

2.3.12

Laravel Version

11.9.2

PHP Version

8.3.0

What server type are you using?

Roadrunner

Server Version

2024.1.2

Database Driver & Version

No response

Description

When streaming a response from a route behind Octane, the response gets buffered and arrives all at once instead of as it is generated.

Currently, wire:stream in Livewire is completely broken when using Laravel Octane, but the issue is not specific to Livewire and my instructions below use native Laravel and vanilla JavaScript only.

Steps To Reproduce

I have created a minimal reproduction repository. Follow the instructions in the README to observe the behaviour of artisan serve as opposed to Octane. There is a small amount of JavaScript in welcome.blade.php that sends the request and outputs the chunks in real time.

Here is the response, note the sleep(1) calls to simulate an artificial delay in receiving the stream chunks. When using artisan serve, there is a second delay between each number appearing. When using Octane, there is a 5 second delay before all numbers appear at once.

return response()->stream(function () {
    echo 1;

    ob_flush();
    flush();
    sleep(1);

    echo 2;

    ob_flush();
    flush();
    sleep(1);

    echo 3;

    ob_flush();
    flush();
    sleep(1);

    echo 4;

    ob_flush();
    flush();
    sleep(1);

    echo 5;
}, 200, [
    'Content-Type' => 'text/html; charset=utf-8;',
    'Cache-Control' => 'no-cache',
    'X-Accel-Buffering' => 'no',
]);
View more
15 comments 👍 19
danharrin

danharrin

4th Jun 2024 @ 11:40

help wanted

Laravel Version

11.13.0

PHP Version

8.3.6

Database Driver & Version

No response

Description

Hello. I change user agent in Http::globalRequestMiddleware like below according to this link:

Http::globalRequestMiddleware(fn ($request) => $request->withHeader(
    'User-Agent', 'Example Application/1.0'
));

When I use RequestSending event like the example in document I get another user agent:

public function LogHttpClientRequests(RequestSending $event)
{
    Log::info('Request Sending Headers:', $event->request->headers());
}

I get GuzzleHttp/7 in log file:

local.INFO: Request Sending Headers: {"User-Agent":["GuzzleHttp/7"]} 

The expected User-Agent is Example Application/1.0. This happens with any modifications in header. The request that is actually get sent has the correct User Agent but the log shows invalid output. How can I get this fixed?

Steps To Reproduce

1- Create app/Providers/HttpClientServiceProvider.php:

public function register(): void
{
}

public function boot(): void
{
    Http::globalRequestMiddleware(fn ($request) => $request->withHeader(
        'User-Agent',
        'Example Application/1.0'
    ));
}

2- Register event in app/Providers/EventServiceProvider.php:

protected $listen = [
    RequestSending::class => [
        LogHttpClientRequests::class,
    ],
    ResponseReceived::class => [
        LogHttpClientRequests::class,
    ],
    ConnectionFailed::class => [
        LogHttpClientRequests::class,
    ],
];

3- Create app/Listeners/LogHttpClientRequests.php:

public function LogHttpClientRequests(RequestSending $event): void
{
    Log::info('Request Sending Headers:', $event->request->headers());
}

4- Run Http::get('https://example.com') in tinker.

View more
4 comments
sky93

sky93

1st Jul 2024 @ 23:31

help wanted Waiting team decision

We've merged #19807 and now the /controller page shows the nice #[MapUploadedFile] attribute.

This new feature is fantastic ... but I wonder if it's a good idea to show it in /controller.

This is one of the most critical chapters of Symfony Docs and part of the "Getting Started" series. So, I think that showing this could be a bit overwhelming for readers, mostly newcomers.

Also, we have this page too, which now looks weird and outdated: https://symfony.com/doc/current/controller/upload_file.html


So, this is what I propose:

  • Update controller/upload_file.rst entirely:
    • Show the #[MapUploadedFile] attribute first
    • Think if we should still show the previous way. If yes, let's do it at the bottom of the article and more concisely
  • Remove the #[MapUploadedFile] docs from controller.rst and only keep a tip mentioning it and linking to the doc about file uploads
  • These changes should only be made on 7.1 branch

What do you think?

View more
3 comments 👍 4
javiereguiluz

javiereguiluz

8th May 2024 @ 11:01

enhancement help wanted

Figure our a way to show a grayed out Laravel logo as a default avatar instead of the current default GitHub one.

View more
8 comments
driesvints

driesvints

29th Sep 2021 @ 10:48