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

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

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

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

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

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 👍 1
lukasmu

lukasmu

7th Sep 2024 @ 15:38

findapr

Im using PHPFlasher in a symfony application however it adds session state when not in use. I am combining it with API Platform and my API itself it stateless so it should not hold any session data (causes errors).

How should i handle this (if even possible?)

View more
13 comments
pimjansen

pimjansen

2nd Jun 2023 @ 12:24

help wanted findapr
protected $listeners = [
        'sweetalertConfirmed',
        'sweetalertDenied',
];
public function logout()
{
        sweetalert()
            ->timer(0)
            ->showDenyButton()
            ->addInfo('confirm or deny action');
}

public function sweetalertConfirmed(array $payload)
{
        auth()->logout();
        sweetalert()->addSuccess('sweetalert was confirmed');
}

public function sweetalertDenied(array $payload)
{
        sweetalert()->addError('sweetalert was denied');
} 

i have code for laravel 10 and livewire 3 and get Uncaught TypeError: Livewire.components is undefined when i click button logout, here my button logout:

<a wire:click.prevent="logout" href="#" class="nav_link" data-bs-toggle="tooltip" data-bs-title="Logout">
    <i class='bx bx-log-out nav_icon'></i>
    <span class="nav_name">Logout</span>
</a>

how can fix this code

View more
andhikapepe

andhikapepe

12th Dec 2023 @ 05:38

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

good first issue hasPR help wanted

The documentation here: https://symfony.com/doc/current/session.html#flash-messages has a single line that says you can use peek() to check for messages while leaving them in the bag, but there is no example of the actual syntax one would need to use in order to achieve this.

The documentation only mentions app.flashes so naturally one would try app.flashes.peek or app.flashes().peek() or maybe app.peek() or app.peek.flashes or even just peek() by itself, or some other variation, but none of these work.

The only way to use peek() is with app.session.flashbag.peek($type) and the $type argument is mandatory, e.g. app.session.flashbag.peek('error'). It's worth noting that app.flashes can take an array, e.g. app.flashes(['error', 'warning']) but peek cannot.

There is also no mention of the very useful peekAll method on that page, nor anywhere else in the Symfony docs. This is used to check for messages of any type, and the syntax is: app.session.flashbag.peekAll

If this could be added, that would be great. Thanks.

View more
pauljura

pauljura

5th Sep 2024 @ 04:00

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

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

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

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

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

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

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

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

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

Laravel Version

11.21.0

PHP Version

8.2.0

Database Driver & Version

MySQL 8.0.31

Description

I have factories, categories and products in my database. Each factory has multiple categories and each category has multiple products. These are 1:n relationships. So for example I use return $this->hasMany(Product::class); in the Category class. In my query I load all categories for all factories and I want to eager load the product count for all categories, but not the products. I do it this way:

    $factories = Factory::all();
    $factories->load(['categories' => function ($category){
        $category->withCount('products');
    }]);

Normally this can be done with a single SQL query, but according to the logs it takes one SQL query for each category instead...

In my blade template I get the product count this way:

    {{$category->name}} ({{$category->products()->count()}})

This appears to be a bug for me, at least I tried it with both with and load with the same result.

Steps To Reproduce

migration:

Schema::create('factories', function (Blueprint $table){
    $table->id();
    $table->string('name');
    $table->timestamps();
});
Schema::create('categories', function (Blueprint $table){
    $table->id();
    $table->foreignId('factory_id')->constrained('factories', 'id')->onUpdate('cascade')->onDelete('cascade');
    $table->string('name');
    $table->timestamps();
});
Schema::create('products', function (Blueprint $table) {
    $table->id();
    $table->foreignId('category_id')->constrained('categories', 'id')->onUpdate('cascade')->onDelete('cascade');
    $table->string('name');
    $table->timestamps();
});

models

class Factory extends Model
{
    use HasFactory;

    public function categories(){
        return $this->hasMany(Category::class);
    }
}

class Category extends Model
{
    use HasFactory;

    public function products(){
        return $this->hasMany(Product::class);
    }
}

controller

$factories = Factory::all();
$factories->load('translation');
$factories->load(['categories' => function ($category){
    $category->withCount('products');
}]);
return View::make('products.index', [
    'factories' => $factories
]);

view:

@foreach ($factories as $factory)
{{$factory->name}}<br>
@foreach ($factory->categories as $category)
{{$category->name}} ({{$category->products()->count()}})<br>
@endforeach
@endforeach

AppServiceProvider

public function boot(): void
{
    if (App::environment('local'))
        DB::listen(function($query) {
            Log::info(
                $query->sql,
                [
                    'bindings' => $query->bindings,
                    'time' => $query->time
                ]
            );
        });
}

If you check the log, then there will be multiple queries in it something like

[2024-09-13 14:26:52] local.INFO: select count(*) as aggregate from products where products.category_id = ? and products.category_id is not null {"bindings":[13],"time":0.69}

View more
1 comment
blablabla1234678

blablabla1234678

13th Sep 2024 @ 14:48

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

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

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
3 comments
Pluuk

Pluuk

1st Jul 2024 @ 07:31

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

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

enhancement help wanted
View more
driesvints

driesvints

12th Mar 2024 @ 10:20

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