Found 54 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.

help wanted

Octane Version

2.5.6

Laravel Version

10.48.22

PHP Version

8.1.29

What server type are you using?

Swoole

Server Version

5.1.4

Database Driver & Version

No response

Description

I noticed that octane+swoole consumes much more memory than standard artisan serve. For example I'm testing file uploads (using raw POST request) with files of different sizes. Results:

File size             | Laravel | Octane |
----------------------------------------------------------------
10 B                  |   8 MB  |  23 MB |
20 MB                 |  22 MB  |  64 MB |
50 MB                 |  53 MB  | 125 MB |

So, looks like with swoole the file is copied twice in memory.

Steps To Reproduce

Create a POST route that does nothing but logs/returns memory_get_peak_usage() and run curl -k --data-binary "@file" -H "Expect:" -H "Content-Type: text/plain" https://host/path/to/route. Make the file "./file" of appropriate size.

Swoole configuration from config/octane.php:

  'swoole' => [
        'options' => [
            'log_file' => storage_path('logs/swoole_http.log'),
            'package_max_length' => env('SWOOLE_PACKAGE_MAX_LENGTH', 50 * 1024 * 1024),
            'enable_coroutine' => false,
            'send_yield' => true,
            'socket_buffer_size' => 10 * 1024 * 1024,
        ],
    ],
View more
6 comments
alecpl

alecpl

27th Sep 2024 @ 10:28

good first issue hacktoberfest

Cachet 2.x can store custom meta data to be passed to incidents. We can extend this in 3.x to support custom meta on most, if not all models.

  • Create Meta model.
  • Add Meta relationship to models.
  • Update actions and API to support passing meta.
  • Add meta to the Http resources.
View more
jbrooksuk

jbrooksuk

14th Sep 2023 @ 18:51

good first issue

At the moment, if you have a job and you specified the number of times it should be retried, you could test it like this:

test('job')
    ->expect('App\Jobs\TestJob')
    ->toBeTriedAgainOnFailure()

However, that merely checks that a $tries property exists on the class and that the value is above 1. I think it would be better if you could specify that number yourself:

test('job')
    ->expect('App\Jobs\TestJob')
    ->toBeTriedAgainOnFailure(maxTries: 5)

If you have a set number that each job should be retried across the application, then this test will help catch where someone has tried to increase it.

There's definitely some other expectations that this can be applied to and I think it will greatly enhance Lawman

View more
JonPurvis

JonPurvis

16th Sep 2024 @ 02:18

help wanted

Laravel Version

11.21.0

PHP Version

8.2

Database Driver & Version

No response

Description

According to the Pusher documentation, the signature must include the full channel name (including prefixes like private-, presence-, and others). See the implementation example in Ruby in the official documentation:

string_to_sign = "1234.1234:private-foobar"
signature = OpenSSL::HMAC.hexdigest(digest, secret, string_to_sign)

https://pusher.com/docs/channels/library_auth_reference/auth-signatures/#private-channel

However, in the validAuthenticationResponse method in PusherBroadcaster.php, there is the following line:

$channelName = $this->normalizeChannelName($request->channel_name);

This line refers to the following implementation in UsePusherChannelConventions.php:

    public function normalizeChannelName($channel)
    {
        foreach (['private-encrypted-', 'private-', 'presence-'] as $prefix) {
            if (Str::startsWith($channel, $prefix)) {
                return Str::replaceFirst($prefix, '', $channel);
            }
        }

        return $channel;
    }

This means that the generated signature is incorrect because the channel name used for signing does not include the prefix. When sending an event on Pusher (I tested this with Soketi):

{"event":"pusher:subscribe","data":{"auth":"ab7aa03b2b2b5f54eb60ce76fb94:4111c21c574e106c05cdc416ac9f9dbfa4a29715e88235ed068b70c8082bde90","channel":"private-projects.1.tasks"}}

You receive the following error because the signature was generated using the channel name without the prefix:


{"event":"pusher:subscription_error","channel":"private-projects.1.tasks","data":{"type":"AuthError","error":"The connection is unauthorized.","status":401}}

Steps To Reproduce

Post request to: http:///api/broadcasting/auth

with the following payload:

socket_id=603005281.6444719709&channel_name=private-projects.1.tasks

View more
2 comments
vingrad

vingrad

31st Aug 2024 @ 13:38

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

help wanted ui long-standing

We welcome contributions adding additional languages to Vanguard.

The danish language has full coverage, from what I've seen, so please copy that file and translate into your intended language and open a PR.

Any language corrections should also be via PR.

I recommend reading this section of the docs for how Vanguard handles internationalization.

Thank you!

View more
lewislarsen

lewislarsen

26th Jul 2024 @ 21:34

good first issue hacktoberfest

The themes dashboard needs finishing and actually needs implementing into the status page. Changing a color doesn’t do anything currently.

View more
jbrooksuk

jbrooksuk

3rd Oct 2024 @ 18:42

enhancement help wanted

Make them not page wide but a rectangle image above the page.

View more
9 comments
driesvints

driesvints

28th Aug 2024 @ 07:55

help wanted

Octane Version

2.6.2

Laravel Version

11.16.0

PHP Version

8.3.6

What server type are you using?

Swoole

Server Version

5.1.2

Database Driver & Version

No response

Description

Before i start, this is not a duplicate to https://github.com/laravel/octane/issues/903, this is about Swoole. Also large stream responses are fixed with https://github.com/laravel/octane/issues/636, but not this case.

While using Storage::download or Storage::response, laravel is creating a stream response that uses php fpassthru($stream). Somehow the buffering between fpassthru and ob_start does not work, instead it tries to load the full file into the memory. This leads to out of memory errors while downloading very big files.

If i replace the fpassthru with a fread-while-loop it is working as expected.

I can basically make a pull request, but need help with the solution... Is this more a problem in the laravel framework or PHP itself?

Steps To Reproduce

  1. Write a laravel controller that uses Storage::download() to download file with e.g. 1 GB
  2. Call the controller and see the out of memory error
View more
4 comments
NiroDeveloper

NiroDeveloper

24th Jul 2024 @ 11:18

help wanted question

AST, or "abstract syntax tree", creates the expectation of a nested tree structure. In the case of a query string, the AST will only ever be one level deep; as multi nodes are combined into one.

If anyone wants to suggest a better, more clear name: you're welcome.

View more
2 comments
brendt

brendt

20th Dec 2018 @ 13:41

Feature help wanted

Calling for help from Docker experts. We need to create the best possible docker-compose.yml file for this project. The application requirements are well defined (we use env vars, Webpack Encore, PHP 7.1, Symfony 4.1, SQLite database, etc.) so it should be possible to create that file.

View more
30 comments 👍 28
javiereguiluz

javiereguiluz

21st May 2018 @ 09:37

help wanted

When using the addToMediaFromURL method, I'm receiving a Could Not Load Image error on the server, but not locally (I'm using Laravel Vapor) and not with other image formats.

The code below is where the error is occuring and that code is receiving an absolute file path to the image in s3, which is available.

public function addToMediaLibrary($file_path) { $media = $this->addMediaFromUrl($file_path) ->toMediaCollection("", 's3'); return $media; }

As an example the file path when logged out is https://s3.sitesforsaas.com/tenants/d221c93a-3757-466c-bf83-b74a9ee64c04/sites/9cfc24c7-cb2a-4c5a-8c0f-73ecdc79c166/2024/09/4e9854b0-4f2d-4931-a726-01f557bd7fc6.webp, but the error is looking for the image in local 'tmp' storage for some reason.

Could not load image at path /tmp/storage/tenantd221c93a-3757-466c-bf83-b74a9ee64c04/media-library/temp/j7pNMerUdReNx9MfAG5rKjcmGHWu4i99/LM2UYMTcYU0BO8sLsTfeOBpS9eXximejlarge.webp`",

View more
👍 3
josiahmann

josiahmann

11th Sep 2024 @ 21:32

enhancement help wanted ui logic long-standing

Contact Details

No response

Feature Title

Add More Notification Support

Feature Description

More Notification options, such as.. Telegram, Pushover, potentially SMS?

For Telegram, users will be able to create a Telegram focused Notification Stream, allowing for backup task notifications to be sent via Telegram bot. Will need a page to link their account.

Vanguard Version

v1.4.1

Current Issues

No response

Additional Context

No response

Resources

No response

View more
2 comments
lewislarsen

lewislarsen

26th Jul 2024 @ 21:22

good first issue hacktoberfest

We need to bring back support for tags.

  • In 2.x only components support being tagged, but we could extend this to other areas including; incidents, metrics and schedules.
  • The API needs to support filtering the endpoint by a tag.
View more
jbrooksuk

jbrooksuk

13th Sep 2023 @ 20:45

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

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

good first issue hacktoberfest

Incidents can be marked as “Sticky” which I think actually makes more sense to just be labelled as “Pin to top”. Logic needs implementing for this.

  1. Update language string from "Sticky" to "Pin to Top".
  2. Any "Sticky" incidents should be at the top of the timeline.
View more
4 comments
jbrooksuk

jbrooksuk

3rd Oct 2024 @ 18:30

help wanted

Laravel Version

11.20.0

PHP Version

8.3.9

Database Driver & Version

No response

Description

So currently there is an issue with contextual binding(LogManager is just example) and Container::call() method, but any alias that is pointing to two different not compatible with each other interfaces can cause this problem.

Basically, we have an issue after upgrading to laravel 9(but also happens on 11) that when we have contextual binding for LoggerInterface::class, but deprecation log is happening there will be an exception triggered for that:

During inheritance of JsonSerializable: Uncaught Error: Call to undefined method Monolog\Logger::channel() in /Users/wslawski/PhpstormProjects/untitled1/example-app/vendor/laravel/framework/src/Illuminate/Log/Logger.php:309 Stack trace: #0 /Users/wslawski/PhpstormProjects/untitled1/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(103): Illuminate\Log\Logger->__call('channel', Array)

The reason is that both classes are aliased as log and laravel container when getting LogManager resolves it to alias log and since there is contextual binding for it, it returns wrong instance, without channel method existing.

I see this being solved by either stopping aliasing incompatible types with each other in the container or somehow resolving the correct type in the first place — don't use contextual binding when it shouldn't be used.

On laravel 8 everything worked as expected - because we laravel didn't update buildStack when resolving dependencies for method calls, and starting from 9 it is happening here - https://github.com/laravel/framework/blob/11.x/src/Illuminate/Container/Container.php#L685

Steps To Reproduce

Service provider:

namespace App\Providers;

use App\Commands\TestCommand;
use App\TestClass;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
use Psr\Log\LoggerInterface;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        $this->app->when(TestClass::class)
            ->needs(LoggerInterface::class)
            ->give(fn() => Log::channel('test'));

        $this->commands([TestCommand::class]);
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        //
    }
}

TestClass:

namespace App;

use App\Test;
use Psr\Log\LoggerInterface;

final class TestClass
{
    public function __construct(
    ) {
    }

    public function handle(LoggerInterface $logger): void
    {
        $xyz = new Test();
        $xyz->jsonSerialize();
    }
}

Test:

namespace App;

final class Test implements \JsonSerializable
{
    public function jsonSerialize()
    {
        return [];
    }
}

TestCommand:

namespace App\Commands;

use App\TestClass;
use Illuminate\Bus\Dispatcher;
use Illuminate\Console\Command;

final class TestCommand extends Command
{
    protected $signature = 'test:deprecation';

    public function handle(Dispatcher $dispatcher): void
    {
        $dispatcher->dispatch(new TestClass());
    }
}

Set LOG_DEPRECATIONS_CHANNEL=single

Run php artisan test:deprecation - you will get an exception that channel method does not exist

View more
5 comments 👍 1
wslawski-printify

wslawski-printify

14th Aug 2024 @ 11:46

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

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
1 comment
driesvints

driesvints

29th Dec 2023 @ 10:43

help wanted

Octane Version

2.3.4

Laravel Version

10.46.0

PHP Version

8.2.20

What server type are you using?

Swoole

Server Version

5.1.1

Database Driver & Version

No response

Description

When the server runs out of memory, swoole is restarted after a restart of the server. Swoole thinks that the process should still be active because the PID is still in the octane-server-state.json, but this process ID doesn't exist anymore. Then in line 22-24 of src/Swoole/SwooleExtension.php it tries to kill a PID which doesn't exist anymore, receives a Operation not permitted[1] error and crashes the process, which is not started anymore.

Steps To Reproduce

  1. Create a laravel octane instance.
  2. Start up the server
  3. Trigger an OOM error on the server
  4. Try to restart the octane instance
View more
4 comments
Pluuk

Pluuk

1st Jul 2024 @ 07:31

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

enhancement help wanted
  • standard tags
  • input fields
  • components
  • patterns

Add code snippets for each block

View more
👍 1
willemvb

willemvb

25th Jul 2016 @ 12:49

bug enhancement good first issue

What happened?

I just installed package and complement for AI powered solution. When I create an issue to test it I get :

Capture d'écran 2024-07-21 125216

I had to change the links function like this to make it work for me:

public function links(): array
{
    $rawText = Str::finish($this->rawText, 'ENDLINKS');

    $textLinks = $this->between('LINKS', 'ENDLINKS', $rawText);

    $textLinks = explode(PHP_EOL, $textLinks);

    $links = [];

    foreach ($textLinks as $textLink) {
        $textLink = str_replace('\\', '\\\\', $textLink);
        $textLink = str_replace('\\\\\\', '\\\\', $textLink);

        $decodedLink = json_decode($textLink, true);

        if ($decodedLink !== null) {
            $links[$decodedLink['title']] = $decodedLink['url'];
        }
    }

    return $links;
}

How to reproduce the bug

When I install the package in my project and use it with AI powered

Package Version

1.0

PHP Version

8.2.14

Laravel Version

11.14

Which operating systems does with happen with?

Windows

Notes

No response

View more
2 comments
bestmomo

bestmomo

21st Jul 2024 @ 10:57

help wanted

Currently, for plural rules, the MessageFormatter polyfills uses the English rules for all locales (it ignores the locale). To be consistent with what we do in symfony/intl (used by symfony/polyfill-intl-icu to implement NumberFormatter and DateFormatter), we should rather fail explicitly here (using the English rules for a different locale would not give the right result anyway)

View more
2 comments
stof

stof

23rd Oct 2018 @ 15:34

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

good first issue hacktoberfest

It should be possible to:

  • Invite additional people to manage your status page.
  • Support roles (admin / user)
View more
jbrooksuk

jbrooksuk

3rd Oct 2024 @ 18:41

good first issue hacktoberfest

Once scheduled maintenance has completed, it should appear in the incident timeline.

View more
👍 1
jbrooksuk

jbrooksuk

5th Oct 2024 @ 07:42

good first issue hacktoberfest

A practical extension for Planned Maintenances / Schedules would be the automatic time-controlled determination of the status.

condition status
now < scheduled_at Upcoming
now > scheduled_at and now < completed_at In Progress
now > completed_at Complete

This would be useful to announce maintenance carried out by third parties, where you only get information about the planned start and end.

I tried to hack this feature together, but I'm not versed enough with Laravel to implement this properly.

View more
5 comments
swoga

swoga

12th Oct 2024 @ 20:52

good first issue hacktoberfest

Couple of improvements to the incident view page.

  • When viewing a single incident at /incidents/{incident} the page doesn't need the "About" section.
  • If an incident is linked to any components, we should display them here.
View more
12 comments
jbrooksuk

jbrooksuk

3rd Oct 2024 @ 18:36

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

help wanted

Laravel Version

11.26.0

PHP Version

8.3.12

Database Driver & Version

No response

Description

Description

If two independent interfaces are implemented by the same concrete class and used in a method binding only the first interface gets resolved.

Probable Cause

Following the issue in debug, it appears to be related to the interaction and logic behind alreadyInParameters and resolveMethodDependencies.

The method alreadyInParameters prevents the multiple injection of objects with the same class but compares the class name against the instanceof of the previous parameters after they have been resolved instead of the requested type of the parameters.

Steps To Reproduce

given the following classes:

interface IInterfaceA
{
    public function doSomethingA();
}
interface IInterfaceB
{
    public function doSomethingB();
}
class ConcreteClass implements IInterfaceA, IInterfaceB
{
    public function doSomethingA()
    {
        // Implementation for doSomethingA
    }

    public function doSomethingB()
    {
        // Implementation for doSomethingB
    }
}

and registered with:

$this->app->singleton(\App\Services\ConcreteClass::class, function (Application $app) {
            return new ConcreteClass();
        });
$this->app->bind(\App\Interfaces\IInterfaceA::class,\App\Services\ConcreteClass::class);
$this->app->bind(\App\Interfaces\IInterfaceB::class,\App\Services\ConcreteClass::class);

the route pointing to the following controller raise an ArgumentCountError

class SampleController extends Controller
{
	public function executeRequest(Request $request,IInterfaceA interfaceA, IInterfaceB interfaceB)
	{
	}
}
View more
1 comment 👍 1
LucaBenini

LucaBenini

11th Oct 2024 @ 08:38

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

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

good first issue hacktoberfest

The dashboard should offer the ability to toggle the theme between:

  • Automatic (System)
  • Light
  • Dark

Further, the dashboard should have a "Theme" option to force a theme mode.

View more
2 comments
jbrooksuk

jbrooksuk

3rd Oct 2024 @ 18:34

documentation good first issue

The docs aren't finished. This issue exists to track the missing pieces:

  • App icons
  • Dock
  • Printing
  • ProgressBar
  • Queue
  • Screens
  • Settings
  • Shell
  • System
  • Touch ID
  • How to customise Electron / PR to NativePHP
  • Security disclosures process
  • Highlight current section
  • Show ToC persistently on the right-hand side
  • Sponsorship page
  • Contributors page
  • Show sponsors in sidebar
  • Add next/previous section buttons to the bottom of pages
  • Add Edit on GitHub link to pages
View more
7 comments
simonhamp

simonhamp

8th Sep 2024 @ 15:01

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

Octane Version

v2.3.10

Laravel Version

v11.6.0

PHP Version

v8.3.6

What server type are you using?

FrankenPHP

Server Version

v1.1.4 PHP 8.3.6 Caddy v2.7.6

Database Driver & Version

Postgress

Description

Last week we updated our app previously using php-fpm running on Forge to use Laravel Octane with FrankenPHP. Our site is mostly an API that handles analytics events (Like google analytics). It uses the default Laravel api throttling.

In staging our app worked fine (30 req/sec same IP), but when deploying to production (1400 req/sec, different IPs) it started to fail, giving a lot of 429 Too Many Requests.

image

I quickly rolled back to php-fpm and after a few hours tried again with the same problem. Rolled back and the next day I switched to Swoole and it worked perfectly without changing a single line of code nor having to redeploy anything. So I can confidently say that is NOT a bug in my code, but rather a bug with FrankenPHP or the Octane integration with FrankenPHP.

My theory is that the RateLimiter is not reseting between requests so it's shared between different users. So multiple different users trigger the rate limiter:

This is my Rate limiter configuration:

// AppServiceProvider

RateLimiter::for('api', function (Request $request) {
    return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});

our production CACHE_STORE is redis. Throttling worked perfectly fine without octane and with octane but using Swoole. It failed with hundred of 429 Too Many Requests after installing FrankenPHP.

This is our bootstrap/app.php:

<?php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\App;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
        then: function () {
            Route::middleware('api')
                ->prefix('api')
                ->as('api.')
                ->domain(config('app.domain'))
                ->group(base_path('routes/api.php'));

            Route::middleware('web')
                ->domain(config('app.domain'))
                ->group(base_path('routes/web.php'));

            Route::middleware('web')
                ->domain(config('playsaurus.ads.domain'))
                ->group(base_path('routes/ads.php'));
        }
    )
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->throttleApi();

        $middleware->redirectTo(
            guests: '/login',
            users: '/',
        );

        $middleware->web(append: [
            \App\Http\Middleware\HandleInertiaRequests::class,
            \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
        ]);

        $middleware->api(append: [
            \App\Http\Middleware\ConfigureLocale::class,
        ]);

        $middleware->alias([
            'localize' => \App\Http\Middleware\ConfigureLocale::class,
            'embed' => \App\Http\Middleware\AllowsEmbeding::class,
        ]);
    })
    ->withExceptions(function (Exceptions $exceptions) {
        $exceptions->dontReport([
            \App\Services\Announcements\InvalidVariantKey::class,
            \App\Exceptions\CouponRedeemException::class,
        ]);
    })->create();

Steps To Reproduce

It's difficult to reproduce. Because I can't test it in production because that would mean a lot of downtime for our users.

My theory is that it would be possible to reproduce from multiple different IPs. But since I don't have the means to test it, I don't know.

View more
9 comments 👍 1
jhm-ciberman

jhm-ciberman

14th May 2024 @ 00:15

help wanted hacktoberfest good first issue documentation

We are logging activity of several models, some using SoftDeletes trait and others not.

When we set config option 'subject_returns_soft_deleted_models' => true then calling subject() on any model not using SoftDeletes trait throws an exception: Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed().

Can the subject() method below be made to check first whether the Model uses the SoftDeletes trait? Or perhaps check whether withTrashed() is a defined method on the Model? I tried a few things but couldn't figure out how to get the class of the Model..

https://github.com/spatie/laravel-activitylog/blob/68eb6e65382f94fe86ce5ff6572159f80d024ba9/src/Models/Activity.php#L28-L35

View more
26 comments
bluec

bluec

7th Nov 2018 @ 13:44

help wanted

Laravel Version

11.24.0

PHP Version

8.2.19

Database Driver & Version

No response

Description

When setting two cookies using Cookie::queue(...), with the same name and path, but different domains, the two cookies are not sent to the client, but the latter one overwrites the prior. It works when calling response()->cookie(...) directly, just not when the cookie is queue.

It appears that Symphony's ResponseHeaderBag::setCookie() handles it by making one level of the cookie map, domain specific: https://github.com/symfony/http-foundation/blob/3d7bbf071b25f802f7d55524d408bed414ea71e2/ResponseHeaderBag.php#L162

However, CookieJar doesn't, only caring about name and path:

https://github.com/laravel/framework/blob/231091c19945f058c576005907a5518fcc7a2bb1/src/Illuminate/Cookie/CookieJar.php#L153

You may be asking why we are setting cookies on two different domains? The answer is that we are transitioning from using CORS to an API server, to instead have each subdomain have separate logins. During this transition we need to set cookies on both the subdomain and domain, and some of our cookies are queued inside services, rather created directly in the controller next to the response. Thanks.

Steps To Reproduce

Ensure the AddQueuedCookiesToResponse middleware is being used.

Add this code to any controller

// Logout request made on www.example.com
Cookie::queue(Cookie::forget('auth_cookie')); // lost
Cookie::queue(Cookie::forget('auth_cookie', domain: '.example.com')); // sent

View the response and see there is only one cookie set.

View more
3 comments
JonathanGawrych

JonathanGawrych

14th Oct 2024 @ 21:47

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

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
12 comments
driesvints

driesvints

29th Sep 2021 @ 10:48

good first issue hacktoberfest

It should be possible to configure Cachet via a cachet:install Artisan command.

v2.x had an interactive command that would ask you questions and store the configuration.

For v3.x, this won't work exactly the same as we now have a mix of .env and database settings, but the idea is the same.

View more
3 comments
jbrooksuk

jbrooksuk

9th Oct 2024 @ 20:21

help wanted

Octane Version

2.5.5

Laravel Version

11.2.0

PHP Version

8.3

What server type are you using?

Swoole

Server Version

5.1.4

Database Driver & Version

MySQL 9.0.1

Description

We are running Laravel on swoole on a kubernetes cluster. Depending on the load the autoscaler starts and stops additionaly instances.

Sometimes we are getting this error: image image

We are not mounting any storage within the container - so every container should have it's own octane-server-state.json file.

Steps To Reproduce

Currently this seems to happen randomly - especially if the application scales up and down.

View more
2 comments
Cluster2a

Cluster2a

20th Sep 2024 @ 08:04

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 good first issue

This code returns an error

QueueSizeCheck::new() ->queue('static_cache', 100),
QueueSizeCheck::new()->queue('default', 100),

Spatie\Health\Exceptions\DuplicateCheckNamesFound You registered checks with a non-unique name: QueueSize. Each check should be unique. If you really want to use the same check class twice, make sure to call name() on them to ensure that they all have unique names.

The current solution is to manually give it a name for each check:

QueueSizeCheck::new() ->queue('static_cache', 100)->name('Queue size (static_cache)'),
QueueSizeCheck::new()->queue('default', 100)->name('Queue size (default)'),

A nice PR would be to put a default name based on queue name

View more
SRWieZ

SRWieZ

8th Aug 2024 @ 19:58

help wanted

Laravel Version

11.20.0

PHP Version

8.3.9

Database Driver & Version

No response

Description

When pushing an array of jobs onto the database queue using the bulk method the JobQueueing and JobQueued events are not triggered.

In contrast, when pushing an array of jobs onto the redis queue or the SQS queue using the bulk method, these event are triggered (as they should be imho).

I think that @RuslanMelnychenko also described symptoms of this bug in https://github.com/laravel/framework/issues/52380.

I see two potential solutions:

Steps To Reproduce

Add a listener for JobQueueing and dispatch jobs onto different queues:

Bus::batch($jobs)->onConnection('database')->dispatch();
Bus::batch($jobs)->onConnection('redis')->dispatch();

The listener will not be invoked when using the database connection, while it will be invoked for the redis connection.

View more
1 comment 👍 2
lukasmu

lukasmu

7th Sep 2024 @ 15:38

enhancement help wanted

Add an option in the admin panel underneath users to delete all threads from a user. This is useful to delete threads in bulk while also banning them after they post spam en masse.

View more
2 comments 👍 1
driesvints

driesvints

21st Oct 2024 @ 07:21

help wanted

Laravel Version

11.28.1

PHP Version

8.3.12

Database Driver & Version

No response

Description

Calling Artisan::call('queue:work') multiple times results in the JobFailed event listener being bound multiple times. As a result of that logFailedJob() being called multiple times and when combined with the DatabaseUuidFailedJobProvider results in an exception being thrown:

Integrity constraint violation: 1062 Duplicate entry '414b6d4b-416e-4eb6-b5e5-9491c36d5146' for key 'failed_jobs.failed_jobs_uuid_unique'

There is a history of that exception and I suspect this is the reason.

Steps To Reproduce

    public function testArtisanCallQueueWork(): void
    {
        $event = \Illuminate\Support\Facades\Event::fake();

        $this->artisan('queue:work', ['--once' => true]);
        $this->artisan('queue:work', ['--once' => true]);

        $this->assertSame(1, count($event->dispatcher->getListeners(\Illuminate\Queue\Events\JobFailed::class)));
    }
View more
1 comment
bytestream

bytestream

18th Oct 2024 @ 15:45

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

good first issue help wanted

We need to implement the metric charts into the status page.

View more
8 comments
jbrooksuk

jbrooksuk

5th Mar 2024 @ 16:00

good first issue hacktoberfest

We need to bring back the various notifications sent by Cachet.

  • Components
    • ComponentStatusChanged
  • Incidents
    • NewIncident
  • Incident Updates
    • IncidentUpdated (this could be moved into the Incidents namespace above.
  • Schedule
    • NewSchedule
  • Subscriber
    • VerifySubscription
  • System
    • Test
View more
2 comments
jbrooksuk

jbrooksuk

13th Sep 2023 @ 18:59

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 good first issue

Describe the bug logUnguarded() works provided that $guarded is set explicitly in the model. If it is not set explicitly but globally set, say in AppServiceProvider using Model::unguard(); then nothing is logged.

To Reproduce

  1. remove $fillable and $guarded from a model that use uses LogsActivity
  2. call Model::unguard(); in AppServiceProvider in the boot method
  3. set
    public function getActivitylogOptions() : LogOptions
    {
        return LogOptions::defaults()->logUnguarded();
    }
  1. Make some changes to a model and save them

Expected behavior Some changed properties should be logged but none are

Versions (please complete the following information)

  • PHP: 8.1
  • Database: MySql
  • Laravel: 9.38
  • Package: larvel-activitylog
View more
1 comment
colinmackinlay

colinmackinlay

20th Nov 2022 @ 12:31