Found 55 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

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
danielmarschall

danielmarschall

7th Jan 2022 @ 00:12

help wanted

Laravel Version

11.0.7

PHP Version

8.3.3

Database Driver & Version

No response

Description

This is a little tricky, but I ran into this issue after upgrading to Laravel 11 and first suspected it was a problem with Blade Heroicons Kit.

In Laravel 11 the optimize command was extended to cache events and views.

When running optimize on a fresh app with the Heroicons kit it blew up:

➜  heroicons php artisan optimize

   INFO  Caching framework bootstrap, configuration, and metadata.  

  config ............................................................................................................................... 7.62ms DONE
  events ............................................................................................................................... 0.71ms DONE
  routes ............................................................................................................................... 5.56ms DONE
  views ............................................................................................................................... 28.61ms FAIL

   InvalidArgumentException 

  Unable to locate a class or view for component [heroicon-s-bars-3].

  at vendor/laravel/framework/src/Illuminate/View/Compilers/ComponentTagCompiler.php:311
    307β–•         if (Str::startsWith($component, 'mail::')) {
    308β–•             return $component;
    309β–•         }
    310β–• 
  ➜ 311β–•         throw new InvalidArgumentException(
    312β–•             "Unable to locate a class or view for component [{$component}]."
    313β–•         );
    314β–•     }
    315β–• 

      +2 vendor frames 

  3   [internal]:0
      Illuminate\View\Compilers\ComponentTagCompiler::Illuminate\View\Compilers\{closure}(["<x-heroicon-s-bars-3 />", "heroicon-s-bars-3", "", ""])
      +7 vendor frames 

  11  [internal]:0
      Illuminate\Foundation\Console\ViewCacheCommand::Illuminate\Foundation\Console\{closure}(Object(Symfony\Component\Finder\SplFileInfo), "/Users/dwight/Sites/heroicons/resources/views/welcome.blade.php")

However, running php artisan view:cache runs fine.

Through playing with the optimize command I realised two things:

  • If I comment out config or route caching from optimize then it works fine. Something that happens in the config:cache or route:cache command is affecting what happens in the view:cache command.
  • The instance of the BladeCompiler from the container and the one that is received inside the ViewCacheCommand appear to be different (and the second doesn't have the Heroicon aliases available)

Steps To Reproduce

laravel new heroicons
cd heroicons
composer require blade-ui-kit/blade-heroicons

Add an icon to the welcome page: <x-heroicon-s-bars-3 />

View more
3 comments
dwightwatson

dwightwatson

18th Mar 2024 @ 08:58

bug unconfirmed low priority help wanted

Package

filament/spatie-laravel-translatable-plugin

Package Version

v3.2.42

Laravel Version

v11.0

Livewire Version

v3.4.6

PHP Version

v8.2.4

Problem description

When i add a Repeater field in my (edit) resource page, all translations don't work and get replaced with: [object Object] When i dump the initial state using some code like this: TextInput::make("short_title")->afterStateHydrated(function (TextInput $component, string $state) { dump($state); }) The text is correct. That makes me think the page gets reloaded by a Repeater, maybe to fill its data? Besides that the repeater creates like 20 empty fields, also strange behaviour.

Something to mention is that i have a table with products and product_variants. The product_variants model is Translatable, but does't have its own page. Maybe it has any effect.

There are some other issues that have the simular problem. (#11175) But none have this behaviour. image

Expected behavior

I expected that the text is in the correct language

Steps to reproduce

Migrate the database, and check the page called Producten, when you click one you see the problem. This is my current project, but this was the first resource that i created.

Reproduction repository

https://github.com/demianottema/TG_Dashboard-V3

Relevant log output

No response

View more
5 comments
demianottema

demianottema

12th Mar 2024 @ 21:12

needs more info help wanted

Laravel Version

11.1.0

PHP Version

8.3.4

Database Driver & Version

MariaDB 10.11

Description

Hi :wave:

I thought I'd just mention this in case anyone else has experienced this since updating to Laravel 11.

I use MariaDB 10.11 in production. Since updating, I'm seeing that my database has been crashing. I've been running my server for a few years now, and it's always been operating on the latest Laravel version, and also has been fine sitting between 75% and 90% memory utilisation (8GB).

Steps To Reproduce

Two noticeable things are different in Laravel 11 compared to Laravel 10:

  1. Removal of dbal package
  2. Mariadb driver

I wanted to figure out whether I'm missing anything. As a result of this, at a cost, I've had to increase my server's memory. I do wonder whether there's a memory leak in how the driver works now in Laravel 11?

Γ— mariadb.service - MariaDB 10.11 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
     Active: failed (Result: oom-kill) since Thu 2024-03-28 04:00:36 EDT; 5min ago
   Duration: 1d 1h 19min 29.156s
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 766 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
    Process: 825 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
    Process: 874 ExecStart=/usr/libexec/mariadbd --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=killed, signal=KILL)
    Process: 1443 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
   Main PID: 874 (code=killed, signal=KILL)
     Status: "Taking your SQL requests now..."
        CPU: 2h 39min 52.288s

Mar 27 02:41:07 domain-monitor-2022 mariadb-check-upgrade[1473]:   1. Back-up your data before with 'mariadb-upgrade'
Mar 27 02:41:07 domain-monitor-2022 mariadb-check-upgrade[1473]:   2. Start the database daemon using 'systemctl start mariadb.service'
Mar 27 02:41:07 domain-monitor-2022 mariadb-check-upgrade[1473]:   3. Run 'mariadb-upgrade' with a database user that has sufficient privileges
Mar 27 02:41:07 domain-monitor-2022 mariadb-check-upgrade[1473]: Read more about 'mariadb-upgrade' usage at:
Mar 27 02:41:07 domain-monitor-2022 mariadb-check-upgrade[1473]: https://mariadb.com/kb/en/mysql_upgrade/
Mar 27 02:41:07 domain-monitor-2022 systemd[1]: Started MariaDB 10.11 database server.
Mar 28 04:00:36 domain-monitor-2022 systemd[1]: mariadb.service: A process of this unit has been killed by the OOM killer.
Mar 28 04:00:36 domain-monitor-2022 systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL
Mar 28 04:00:36 domain-monitor-2022 systemd[1]: mariadb.service: Failed with result 'oom-kill'.
Mar 28 04:00:36 domain-monitor-2022 systemd[1]: mariadb.service: Consumed 2h 39min 52.288s CPU time.

It's been almost 3 hours since rebooting my database server, and I'm seeing the memory usage here at 1GB

● mariadb.service - MariaDB 10.11 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
     Active: active (running) since Thu 2024-03-28 04:25:45 EDT; 2h 23min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 834 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
    Process: 887 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
    Process: 1182 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
   Main PID: 946 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 95 (limit: 100205)
     Memory: 1.0G
        CPU: 15min 19.823s
     CGroup: /system.slice/mariadb.service
             └─946 /usr/libexec/mariadbd --basedir=/usr

Mar 28 04:25:44 domain-monitor-2022 systemd[1]: Starting MariaDB 10.11 database server...
Mar 28 04:25:44 domain-monitor-2022 mariadb-prepare-db-dir[887]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Mar 28 04:25:44 domain-monitor-2022 mariadb-prepare-db-dir[887]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]: The datadir located at /var/lib/mysql needs to be upgraded using 'mariadb-upgrade' tool. This can be done using the fo>
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]:   1. Back-up your data before with 'mariadb-upgrade'
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]:   2. Start the database daemon using 'systemctl start mariadb.service'
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]:   3. Run 'mariadb-upgrade' with a database user that has sufficient privileges
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]: Read more about 'mariadb-upgrade' usage at:
Mar 28 04:25:45 domain-monitor-2022 mariadb-check-upgrade[1212]: https://mariadb.com/kb/en/mysql_upgrade/
Mar 28 04:25:45 domain-monitor-2022 systemd[1]: Started MariaDB 10.11 database server.
View more
18 comments
sts-ryan-holton

sts-ryan-holton

28th Mar 2024 @ 10:50

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

v3.2.35

Laravel Version

v10.45.1

Livewire Version

No response

PHP Version

PHP 8.3.3

Problem description

When a Builder is used in a Resource managed by filament/spatie-laravel-translatable-plugin, the error Undefined array key "afterItem" is returned when trying to insert a block between others.

I was able to trace the error to this line and it arises because the blocks for translations do not have a UUID: https://github.com/filamentphp/filament/blob/27dca4d0c2dabcf71d9dbcf03cdeb2fd98f8a1ce/packages/forms/src/Components/Builder.php#L190

Here is the dump for the $arguments when saving in English: CleanShot 2024-02-23 at 09 50 18@2x

Here is the dump for the $arguments when saving in other languages. We can see the UUID and afterItem key is missing. CleanShot 2024-02-23 at 09 51 00@2x

Here is the full error in video:

https://github.com/filamentphp/filament/assets/287688/3f54d820-4869-4fd1-810f-966288ae856d

Expected behavior

No error should occur.

Steps to reproduce

  • Clone the repository.
  • Migrate
  • Seed
  • Go to Products, edit any.
  • Switch to FRENCH
  • Try inserting a block between the two existing.

CleanShot 2024-02-23 at 09 47 32@2x

Reproduction repository

https://github.com/AlexisSerneels/filament-issue

Relevant log output

No response

View more
AlexisSerneels

AlexisSerneels

23rd Feb 2024 @ 08:53

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

bug unconfirmed help wanted high priority

Package

filament/forms

Package Version

v3.2.10

Laravel Version

v10.41.0

Livewire Version

v3.3.5

PHP Version

PHP 8.1, 8.2, 8.3

Problem description

When using a RichEditor inside a modal (eg. for a relation manager) the image upload feature doesn't work

it uploads the image to the backend but then alpine throws an exception:

Uncaught Could not find Livewire component in DOM tree

Expected behavior

the image preview should show up

Steps to reproduce

  • composer install
  • php artisan migrate --seed
  • php artisan serve
  • login in filament panel with default credentials
  • navigate in Pages and open Home in edit mode
  • inside the Content field's RichEditor add an image, it uploads without issues (just a minor issue because it doesn't get the :8000 port exposed by php artisan serve, so preview doesn't show)
  • open the Section inside the Sections Relation Manager, a modal will show up
  • inside the modal RichTextEditor uploads an image, it shows up and disappears immediately

an Uncaught Could not find Livewire component in DOM tree exception appears in the browser console

Reproduction repository

https://github.com/fabio-ivona/filament-image-upload-issue

Relevant log output

Browser console output

Uncaught Could not find Livewire component in DOM tree @ livewire.js?id=e2b302e9:4451
closestComponent @ livewire.js?id=e2b302e9:4451
get @ livewire.js?id=e2b302e9:4248
eval @ VM354:13
markUploadFinished @ livewire.js?id=e2b302e9:614
(anonymous) @ livewire.js?id=e2b302e9:521
(anonymous) @ livewire.js?id=e2b302e9:4493
dispatchEvent @ livewire.js?id=e2b302e9:4510
dispatchSelf @ livewire.js?id=e2b302e9:4483
(anonymous) @ livewire.js?id=e2b302e9:8836
dispatchEvents @ livewire.js?id=e2b302e9:8834
(anonymous) @ livewire.js?id=e2b302e9:8811
trigger @ livewire.js?id=e2b302e9:433
processEffects @ livewire.js?id=e2b302e9:4393
handleResponse @ livewire.js?id=e2b302e9:3990
(anonymous) @ livewire.js?id=e2b302e9:3925
succeed @ livewire.js?id=e2b302e9:3925
sendRequest @ livewire.js?id=e2b302e9:4177
await in sendRequest (async)
send @ livewire.js?id=e2b302e9:3910
(anonymous) @ livewire.js?id=e2b302e9:4054
createAndSendNewPool @ livewire.js?id=e2b302e9:4050
(anonymous) @ livewire.js?id=e2b302e9:4026
(anonymous) @ livewire.js?id=e2b302e9:4089
setTimeout (async)
bufferPoolingForFiveMs @ livewire.js?id=e2b302e9:4088
add @ livewire.js?id=e2b302e9:4023
requestCall @ livewire.js?id=e2b302e9:4105
(anonymous) @ livewire.js?id=e2b302e9:4336
(anonymous) @ livewire.js?id=e2b302e9:4275
(anonymous) @ livewire.js?id=e2b302e9:593
load (async)
makeRequest @ livewire.js?id=e2b302e9:590
handleSignedUrl @ livewire.js?id=e2b302e9:565
(anonymous) @ livewire.js?id=e2b302e9:515
(anonymous) @ livewire.js?id=e2b302e9:4493
dispatchEvent @ livewire.js?id=e2b302e9:4510
dispatchSelf @ livewire.js?id=e2b302e9:4483
(anonymous) @ livewire.js?id=e2b302e9:8836
dispatchEvents @ livewire.js?id=e2b302e9:8834
(anonymous) @ livewire.js?id=e2b302e9:8811
trigger @ livewire.js?id=e2b302e9:433
processEffects @ livewire.js?id=e2b302e9:4393
handleResponse @ livewire.js?id=e2b302e9:3990
(anonymous) @ livewire.js?id=e2b302e9:3925
succeed @ livewire.js?id=e2b302e9:3925
sendRequest @ livewire.js?id=e2b302e9:4177
await in sendRequest (async)
send @ livewire.js?id=e2b302e9:3910
(anonymous) @ livewire.js?id=e2b302e9:4054
createAndSendNewPool @ livewire.js?id=e2b302e9:4050
(anonymous) @ livewire.js?id=e2b302e9:4026
(anonymous) @ livewire.js?id=e2b302e9:4089
setTimeout (async)
bufferPoolingForFiveMs @ livewire.js?id=e2b302e9:4088
add @ livewire.js?id=e2b302e9:4023
requestCall @ livewire.js?id=e2b302e9:4105
(anonymous) @ livewire.js?id=e2b302e9:4336
(anonymous) @ livewire.js?id=e2b302e9:4275
startUpload @ livewire.js?id=e2b302e9:608
setUpload @ livewire.js?id=e2b302e9:553
upload @ livewire.js?id=e2b302e9:526
upload @ livewire.js?id=e2b302e9:670
(anonymous) @ livewire.js?id=e2b302e9:4306
eval @ VM354:8
[Alpine] 
                    if (! $event.attachment.file) return

                    let attachment = $event.attachment

                    $wire.upload(
                        `componentFileAttachments.mountedTableActionsData.0.content`,
                        attachment.file,
                        () => {
                            $wire
                                .getFormComponentFileAttachmentUrl('mountedTableActionsData.0.content')
                                .then((url) => {
                                    attachment.setAttributes({
                                        url: url,
                                        href: url,
                                    })
                                })
                        },
                    )
                 @ VM354:22
(anonymous) @ livewire.js?id=e2b302e9:1271
tryCatch @ livewire.js?id=e2b302e9:1191
(anonymous) @ livewire.js?id=e2b302e9:3779
handler4 @ livewire.js?id=e2b302e9:3114
(anonymous) @ livewire.js?id=e2b302e9:3179
(anonymous) @ livewire.js?id=e2b302e9:3116
triggerEvent @ rich-editor.js?v=3.2.10.0:2
notify @ rich-editor.js?v=3.2.10.0:143
i.notifyEditorElement @ rich-editor.js?v=3.2.10.0:92
i.compositionDidAddAttachment @ rich-editor.js?v=3.2.10.0:92
c.refreshAttachments @ rich-editor.js?v=3.2.10.0:86
c.setDocument @ rich-editor.js?v=3.2.10.0:85
c.insertText @ rich-editor.js?v=3.2.10.0:85
c.insertAttachments @ rich-editor.js?v=3.2.10.0:86
c.insertFiles @ rich-editor.js?v=3.2.10.0:86
b.insertFiles @ rich-editor.js?v=3.2.10.0:92
(anonymous) @ rich-editor.js?v=3.2.10.0:92
(anonymous) @ rich-editor.js?v=3.2.10.0:42
View more
6 comments
fabio-ivona

fabio-ivona

23rd Jan 2024 @ 12:16

help wanted

Laravel Version

10.47.1

PHP Version

8.3.3

Database Driver & Version

mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)

Description

I noticed a lazy violation exception in production, and I had created a test to reproduce the issue but the test passed. After I added the following code to my TestCase ($this->withoutExceptionHandling();), the test started to fail, and a bunch of other tests failed. I think "LazyLoadingViolationException" should be reported during tests (this is the perfect moment to catch these errors).

However they get correctly reported, but silently in the logs.

That may be a confusion/misunderstanding over what is the purpose of handling exceptions during feature tests (I did not find any usable information in the documentation about the why).

I was also surprised to have detected other "hidden" exceptions since I disabled exception handling (but that is outside the scope of this issue).

Steps To Reproduce

With a model with a one to many relationship (example shopping list -> items), controller loops through the items, and the tests should ensure 2 or more items are attached to the tested model (shopping list).

// app/app/Providers/AppServiceProvider.php

declare(strict_types=1);

namespace App\Providers;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;
use Sentry\Laravel\Integration;

final class AppServiceProvider extends ServiceProvider
{
  public function boot(): void
  {
    Model::preventLazyLoading();

    if (App::isProduction()) {
      Model::handleLazyLoadingViolationUsing(Integration::lazyLoadingViolationReporter());
    }
  }
}
// app/tests/TestCase.php

declare(strict_types=1);

namespace Tests;

use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\Http;

abstract class TestCase extends BaseTestCase
{
  use CreatesApplication;
  use LazilyRefreshDatabase;

  protected bool $seed = true;

  protected function setUp(): void
  {
    parent::setUp();

    $this->withoutVite();
    $this->withoutMix();
    $this->withoutExceptionHandling(); // When this line is commented, the test below does not fail (not wanted)

    Http::preventStrayRequests();
  }
}
// app/tests/Feature/Http/Controllers/ShoppingListCopyControllerTest.php

declare(strict_types=1);

namespace Tests\Feature\Http\Controllers;

use App\Models\Aisle;
use App\Models\Item;
use App\Models\ShoppingList;
use App\Models\Subscription;
use App\Models\User;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

final class ShoppingListCopyControllerTest extends TestCase
{
  use WithFaker;

  public function testMemberDoesntGetItemsOwnerAisleWhenDuplicatingShoppingList(): void
  {
    $user = User::factory()
      ->has(Subscription::factory()->standard())
      ->create();

    $shoppingList = ShoppingList::factory()->for($user, "author")
      ->has(Item::factory()->for(Aisle::factory()->for($user)))
      ->has(Item::factory()->for(Aisle::factory()->for($user)))
      ->has(User::factory()->has(Subscription::factory()->standard()), "members")
      ->create();

    $member = $shoppingList->members->first();

    assert($member instanceof User);

    $this->actingAs($member)
      ->post(route("shopping-list.copy.store", $shoppingList), [
        "name" => $this->faker->name(),
      ])
      ->assertValid();
  }
}
// app/app/Http/Controllers/ShoppingListCopyController.php

declare(strict_types=1);

namespace App\Http\Controllers;

use App\Http\Requests\StoreShoppingListCopyRequest;
use App\Models\Item;
use App\Models\ShoppingList;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\DB;

final class ShoppingListCopyController extends Controller
{
  public function store(StoreShoppingListCopyRequest $request, ShoppingList $shoppingList): RedirectResponse
  {
    $user = $request->user();
    $duplicatedShoppingList = $shoppingList->replicate();

    \assert($duplicatedShoppingList instanceof ShoppingList);

    DB::beginTransaction();

    $duplicatedShoppingList->name = $request->string("name")->toString();
    $duplicatedShoppingList->author()->associate($user);
    $duplicatedShoppingList->save();

    $duplicatedItems = $shoppingList
      ->items
      ->map(function (Item $item) use ($user): Item {
        $duplicatedItem = $item->replicate();

        if (!$item->aisle?->user?->is($user)) { // lazy loading violation here
          $duplicatedItem->aisle()->dissociate();
        }

        return $duplicatedItem;
      });

    $duplicatedShoppingList
      ->items()
      ->saveMany($duplicatedItems);

    DB::commit();

    return redirect()->route("shopping-list.show", $duplicatedShoppingList);
  }
}
// app/app/Exceptions/Handler.php

declare(strict_types=1);

namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Support\Facades\App;
use Sentry\Laravel\Integration;
use Throwable;

final class Handler extends ExceptionHandler
{
  /**
   * A list of the exception types that are not reported.>
   */
  protected $dontReport = [];

  protected $dontFlash = [
    "current_password",
    "password",
    "password_confirmation",
  ];

  public function register(): void
  {
    $this->reportable(function (Throwable $e): void {
      /**
       * @see https://docs.sentry.io/platforms/php/guides/laravel/#install
       */
      if (!App::environment("local")) {
        Integration::captureUnhandledException($e);
      }
    });
  }
}

Edit: I had to explicitly list which exceptions the framework should handle so that all new exceptions are not handled and I can decide which one should be. In my opinion this should be done behind the scene so that everything that can be asserted (validation, authorization, ...) is handled by default and everything that is not assertable (lazy loading violations etc...) keep popping up in the CLI.

This code below produces the results I expect, so that new missing attributes or violation exceptions gets detected.

// app/tests/TestCase.php

declare(strict_types=1);

namespace Tests;

use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\Http;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\HttpException;

abstract class TestCase extends BaseTestCase
{
  use CreatesApplication;
  use LazilyRefreshDatabase;

  protected bool $seed = true;

  protected function setUp(): void
  {
    parent::setUp();

    $this->withoutVite();
    $this->withoutMix();
    $this->handleExceptions([
      AuthorizationException::class,
      HttpException::class,
      ValidationException::class,
      ModelNotFoundException::class,
    ]);

    Http::preventStrayRequests();
  }
}
View more
1 comment
khalyomede

khalyomede

8th Mar 2024 @ 21:08

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

v3.2.16

Laravel Version

v10.41.0

Livewire Version

No response

PHP Version

PHP8.2.15

Problem description

KeyValue::make('meta')
    ->reorderable()

This should reorder the key/values and save them in the db as such. However when you change the order and reload the page or go back to the edit page. The ordering has not changed

Expected behavior

The Ordering set by the user should be respected

Steps to reproduce

  1. go to http://filament-issue.test/admin/products/1/edit
  2. Save an order.
  3. Go back to http://filament-issue.test/admin/products/1/edit
  4. Change the order and save.
  5. Reload and the order has not changed

Reproduction repository

https://github.com/sandersjj/filament-issue

Relevant log output

No response

View more
4 comments
sandersjj

sandersjj

28th Jan 2024 @ 21:18

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

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

help wanted

Laravel Version

10.46.0

PHP Version

8.1.27

Database Driver & Version

No response

Description

We've identified an issue whereby in multi-server environments where commands are scheduled to run using withoutOverlapping() and onOneServer(), the commands will very occasionally not run at all on any server (about 0.2% of the time in our environment). Not a problem for things running every minute where we first spotted the problem, but more impactful when things running a few times or once per day are skipped.

Just going to start with outlining my understanding of how scheduled commands get run when withoutOverlapping() and onOneServer() are used:

  • Commands due to run are iterated over (ScheduleRunCommand::handle, L121)
  • Each command is checked to ensure filters pass before proceeding (ScheduleRunCommand::handle, L122)
    • Because we used withoutOverlapping() a check is added to the filters to ensure the event mutex lock does not currently exist (Event::withoutOverlapping, L713)
  • For each command that passes the filters (i.e. considered to be not currently running), serverShouldRun() is then called to check for and take a scheduling lock for the current server to run the command for the current hour/minute (ScheduleRunCommand::runSingleServerEvent, L156)
  • Once confirmed that the event is not currently running and the server has the lock to run the event for the current schedule run, Event::run is called (Event::run, L217)
  • As a final check before the event runs, shouldSkipDueToOverlapping() is called which checks whether withoutOverlapping() was used and checks that the event lock can be obtained (Event::shouldSkipDueToOverlapping, L237)

Just for clarity, there's two locks in play;

  • The event lock which is used by withoutOverlapping() to identify whether a command is already being run.
  • The scheduling lock used by onOneSever() to check whether a command has already been run on a server for the current schedule run (identified by the current hour and minute.)

The problem stems from the way in which the event mutex lock is checked for existence, which was introduced in PR #45963.

Originally, the CacheEventMutex would just check if the cache had an entry for the lock (CacheEventMutex::exists, L69) which worked fine, but PR #45963 changed that behavior. For cache stores that implement the LockProvider interface (Redis, Memcached) it now attempts to get the lock and then immediately releases it again (but this is not done atomically.)

So the race condition looks something like this if Server B's system clock is just slightly slower than Server A:

Time Server A Server B
12:00:00 Checking that Event A is not currently running, takes event lock for Event A
12:00:01 Releases event lock for Event A, determining that it is not currently running so should be run
12:00:02 Takes scheduling lock for Event A to run on Server A
12:00:03 Checking that Event A is not currently running, takes event lock for Event A
12:00:04 Attempts to take the event lock for Event A to run it, fails because Server B has the lock, then skips due to overlapping
12:00:05 Releases event lock for Event A, determining that it is not currently running so should be run
12:00:06 Attempts to take scheduling lock for Event A to run on Server B, fails as the scheduling lock was already taken by Server A, skips assuming command was run on another server already

So in this scenario the scheduled command is never run, there's no error message, and the ScheduledTaskSkipped doesn't even get fired because the call to run() just returns if shouldSkipDueToOverlapping() returns true.

In terms of a solution, it might make sense to be able to check for the existence of a lock without taking and releasing it, maybe a new abstract exists() on Lock (https://github.com/laravel/framework/blob/10.x/src/Illuminate/Cache/Lock.php) which CacheEventMutex could use and RedisLock/MemcachedLock could implement their own atomic means of checking for lock existence, although that probably constitutes a backwards-compatibility break. Happy to put together a PR for whatever the agreed solution is.

As a workaround, I've just bound an older version of CacheEventMutex to Illuminate\Console\Scheduling\EventMutex to override the changes implemented in #45963 which has solved the issue in our project for now.

Steps To Reproduce

Given its a race condition its very hard to reproduce, but hopefully there's enough details in the description to understand what's going on.

View more
3 comments πŸ‘€ 1
nickma42

nickma42

1st Mar 2024 @ 15:30

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

unconfirmed bug in dependency low priority help wanted

Package

filament/filament

Package Version

v3.2.14

Laravel Version

10.42.0

Livewire Version

v3.4.1

PHP Version

8.2.15

Problem description

If you have a wizard with a hidden step, and you conditionally show that step, the file upload after that hidden step will not work property and with throw the following JS error

Uncaught (in promise) TypeError: this.pond is null

This issue was introduced in version 3.1.24 (I believe this was the PR https://github.com/filamentphp/filament/pull/10371)

Expected behavior

The file upload works properly even if it's after a hidden-step-turned-visible

Steps to reproduce

  1. Create a form with a wizard and 3 steps
  2. Add a file upload component in step 3
  3. Make step 2 conditionally hidden
  4. Toggle the 2nd step's visibility status
  5. Open the browser console, go to step 3 and try to upload a file
  6. You will see an error in the console

Here is a simple form that can reproduce this

Wizard::make([
    Wizard\Step::make('Step 1')
        ->schema([
            Toggle::make('something')
                ->label('Show step 2')
                ->live()
        ]),
    Wizard\Step::make('Hidden step')
        ->visible(fn (Get $get) => $get('something'))
        ->schema([]), // nothing to do here
    Wizard\Step::make('Step 3')
        ->schema([
            FileUpload::make('media')
                ->hint('Open the browser console and try to upload a file')
        ])
])

Reproduction repository

https://github.com/sprtk-ches/laravel-filament

Relevant log output

Uncaught (in promise) TypeError: this.pond is null
    B http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:40
    i http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
    setTimeout handler*Ml http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
    i http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
    i http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
    fire http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
    b http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    E http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    setTimeout handler*yd/E/</< http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    E http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    E http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    _write http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    <anonymous> http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    <anonymous> http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:2
    d http://filament.local/js/filament/forms/components/file-upload.js?v=3.2.14.0:1
...
file-upload.js:40:85386
View more
6 comments
sprtk-ches

sprtk-ches

26th Jan 2024 @ 12:45

help wanted

Octane Version

2.0.2

Laravel Version

10.15.0

PHP Version

8.1

What server type are you using?

Swoole

Server Version

5.0.3

Database Driver & Version

No response

Description

In my tests i can achieve over 2000 RPS with Laravel Octane and Swoole. But if i add an log message to every request, the Performance drops dramatically to under 100 RPS.

What I have already found out:

  • This Bottleneck scales with the length of the log message
  • $server->disableOutput() in StartSwooleCommand fixes the problem

This is a critical problem! You can say now that you shouldn't log so much ... however, many error messages with exceptions would immediately paralyze the service.

Steps To Reproduce

  • Add Laravel Route
  • Add Log Message to Route
  • Print some data like Str::random(512)
View more
23 comments
NiroDeveloper

NiroDeveloper

25th Jul 2023 @ 09:02

bug help wanted

Laravel Version

10.42.0

PHP Version

8.3.2

Database Driver & Version

Redis 7.2.4

Description

Queued jobs with ShouldBeUnique may cause stale unique locks in the case when the dependent model is missing.

According to the source code of the CallQueuedHandler::call() unique lock cleanup may never be reached in case if the job depends on the missing model AND the job is configured to be deleted when the model is missing (public $deleteWhenMissingModels = true).

Steps To Reproduce

The PoC is made using Redis queue, a similar approach may work with other drivers.

  1. Create a new project: laravel new poc.
  2. Ensure Redis is configured & reachable in your .env file. WARNING: PoC will flush all keys.
  3. Create poc.php file with the following contents:
<?php

use Illuminate\Bus\Queueable;
use Illuminate\Queue\WorkerOptions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Redis;
use Illuminate\Queue\SerializesModels;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldBeUnique;

require 'vendor/autoload.php';
$app = require __DIR__.'/bootstrap/app.php';
$cli = $app->make(Kernel::class);
$cli->bootstrap();

config([
    'database.default' => 'sqlite',
    'queue.default' => 'redis',
    'cache.default' => 'redis',
]);

@unlink(config('database.connections.sqlite.database'));
$cli->call('migrate', ['--force' => true]);

DB::unprepared("
    CREATE TABLE IF NOT EXISTS main (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) UNIQUE
    )
");

DB::unprepared("
    CREATE TABLE IF NOT EXISTS secondary (
        id INTEGER NOT NULL PRIMARY KEY,
        name VARCHAR(255) NOT NULL
    )
");

// ensure there are no keys in the DB
Redis::flushdb();

class Main extends Model {
    public $table = 'main';
    public $timestamps = false;
    public $fillable = ['name'];
}

class Secondary extends Model {
    public $table = 'secondary';
    public $timestamps = false;
    public $fillable = ['name'];
}

class MyJob implements ShouldQueue, ShouldBeUnique {
    use Dispatchable, Queueable, SerializesModels;

    public $tries = 1;
    public $maxExceptions = 1;
    public $deleteWhenMissingModels = true;

    public function __construct(
        public Main $main,
        public Secondary $secondary,
    )
    {
    }

    public function handle() {
    }

    public function uniqueId() {
        return 'job-for-' . $this->main->id;
    }
}

// create 2 instances
$main = Main::create(['name' => 'main model']);
$secondary = Secondary::create(['name' => 'secondary model']);

// and schedule a job for them
MyJob::dispatch($main, $secondary);

// delete the secondary model
$secondary->delete();

// run the job
app('queue.worker')->runNextJob('redis', 'default', new WorkerOptions);

echo 'Queue size: ', Queue::size('default'), PHP_EOL; // no tasks left
echo 'Redis contents:', PHP_EOL;
dump(Redis::keys('*')); // unique id is still there
  1. Execute the poc.php php poc.php
  2. Inspect the output to see the stale unique lock

Output

Queue size: 0
Redis contents:
array:1 [
  0 => "laravel_database_laravel_cache_:laravel_unique_job:MyJobjob-for-1"
] // poc.php:95

Expected result

The unique lock has been removed.

Actual result

A stale unique lock still exists.

View more
10 comments
naquad

naquad

29th Jan 2024 @ 11:00

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

3.2.34

Laravel Version

v10.45.1

Livewire Version

v3.4.6

PHP Version

8.3.2

Problem description

If you have dynamic Tooltips like this:

<?php
TextColumn::make('text')                
    ->tooltip(fn(TextColumn $column, ?string $state): ?string =>
         strlen($state) <= $column->getCharacterLimit() 
            ? null 
            : $state)

And the state changes so that null would be returned the tooltip will not be disappear but still show the old value. This can happen if you use, for example, the filament/spatie-laravel-translatable-plugin package and switch languages.

Expected behavior

The Tooltip should not appear with the old value again if a falsify value is returned from the evaluation function.

Steps to reproduce

First have a evaluation function that returns a string for the tooltip, than dynamically change something to not full fill the condition and return false, null or ''.

In the Repo:

  1. Install Dependencies
  2. run php artisan migrate --seed
  3. Go to Posts
  4. Check the Tooltip on title column
  5. switch Language to Spanish
  6. Old Tooltip with english text should still be there

ResourcePath: app/Filament/Resources/Blog/PostResource.php:43

Reproduction repository

https://github.com/thettler/demo/tree/tooltip-not-disappear

Relevant log output

No response

View more
thettler

thettler

27th Feb 2024 @ 15:42

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

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

AshAllenDesign\FaviconFetcher\Drivers\HttpDriver::convertToAbsoluteUrl(): Argument #2 ($faviconUrl) must be of type string, null given, called in /Users/tgugnani/Code/thehome/vendor/ashallendesign/favicon-fetcher/src/Drivers/HttpDriver.php on line 189

When trying to fetch favicon from a URL which does not have a href tag in it, exception is thrown. Can we modify the code so that fails gracefully.

View more
3 comments
tushargugnani

tushargugnani

8th Mar 2024 @ 07:36

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

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

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

enhancement help wanted
View more
driesvints

driesvints

12th Mar 2024 @ 10:20

help wanted

Laravel Version

10.27.0

PHP Version

8.1.11

Database Driver & Version

MySQL

Description

The DB connector code is meant to retry failed connections, but failing to connect due to a connect timeout is not retried. I have observed this on MySQL, but possibly other drivers suffer the same issue.

Steps To Reproduce

Using the mysql driver, set the host to google.com. Only one attempt is made to connect to the DB because tryAgainIfCausedByLostConnection determines that message SQLSTATE[HY000] [2002] Operation timed out should not be re-tried. I think the tryAgainIfCausedByLostConnection logic is great for re-connecting post-connect, but is not so good for retrying the initial connect. I think we need to add additional message matching specifically for the connector code, only. A timeout should not otherwise be retried, since that could result in double inserts, for example.

View more
4 comments πŸ‘ 4
GrahamCampbell

GrahamCampbell

10th Oct 2023 @ 11:56

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

brendt

20th Dec 2018 @ 13:41

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

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

Laravel Version

11.0.7

PHP Version

8.3.4

Database Driver & Version

MariaDB 10.11.7

Description

The default hashing method of my application is argon2id. However, I've still some users with a bcrypt password.

PR https://github.com/laravel/framework/pull/48665 introduces password rehashing - that's enabled in my application. However, if a user authenticates via basic or onceBasic, the password is not rehashed and the error is thrown. In Laravel 10 they were able to login (keeping their bcrypt hashed password), however in Laravel 11 an error is being triggered: This password does not use the Argon2id algorithm., which is true - but I would expect that they can login and that their password will be rehashed. If a user use the 'normal' login via Auth::attempt() it works properly.

I'm willing to prepare a PR to solve this, but I've no time to dive into it on short term - so I just created this issue for now.

Steps To Reproduce

  1. Create a user with a bcrypt hashed password in a Laravel 11 application
  2. Set the HASH_DRIVER to argon2id
  3. Try to login with the user via basic or onceBasic, the login attempt will fail
View more
10 comments πŸ‘ 1
joostdebruijn

joostdebruijn

18th Mar 2024 @ 16:44

enhancement help wanted

While the BrowserKit package is still maintained, it hasn't bee the default in Laravel for some time. It would be cool to port all the browser kit tests to HTTP tests and remove the laravel/browser-kit-testing dependency.

View more
3 comments
joedixon

joedixon

13th Dec 2023 @ 08:17

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

bug help wanted

Laravel Version

10.45.0

PHP Version

8.3.1

Database Driver & Version

No response

Description

When using Tailwind's container queries plugin with the @class directive, Blade either throws exceptions about unexpected endif or simply doesn't compile the classes correct. Using Arr::toCssClasses directly works as expected.

The following examples are in the reproduction repo. (Note: Tailwind isn't installed and configured, but it isn't necessary to show the issues with the Blade compiler.)

Code that works

/success shows everything working as expected with the Arr::toCssClasses

I suspect this is working due to Blade wrapping everything in e().

Here's a snippet of the code that works (full example in the repo):

@if (filled($heading))
    <h1
        class="{{
            Illuminate\Support\Arr::toCssClasses([
                'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
                'mt-10' => filled($callout),
                '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
            ])
        }}"
    >
        {{ $heading }}
    </h1>
@endif

@if (filled($description))
    <div
        class="{{
            Illuminate\Support\Arr::toCssClasses([
                'text-lg/8 text-gray-600',
                'mt-6' => filled($heading),
                'mt-10' => filled($callout) && blank($heading),
                '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
            ])
        }}"
    >
        {{ $description }}
    </div>
@endif

Code that throws an exception

/failure shows the exception (though this may be compounded by wrapping the HTML in conditionals)

Here's a snippet of the code that throws an exception (full example in the repo):

@if (filled($heading))
    <h1
        @class([
            'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
            'mt-10' => filled($callout),
            '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
        ])
    >
        {{ $heading }}
    </h1>
@endif

@if (filled($description))
    <div
        @class([
            'text-lg/8 text-gray-600',
            'mt-6' => filled($heading),
            'mt-10' => filled($callout) && blank($heading),
            '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
        ])
    >
        {{ $description }}
    </div>
@endif

Code that compiles incorrectly

/incorrect is the same thing as /failure but without the conditionals (you can see that the content of the @class call is simply output on the page)

Here's a snippet of the code that compiles incorrectly (full example in the repo):

<h1
    @class([
        'font-bold tracking-tight text-gray-900 @xs:text-4xl @md:text-6xl',
        'mt-10' => filled($callout),
        '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout)
    ])
>
    {{ $heading }}
</h1>

<div
    @class([
        'text-lg/8 text-gray-600',
        'mt-6' => filled($heading),
        'mt-10' => filled($callout) && blank($heading),
        '@xs:mt-24 @md:mt-32 @xl:mt-16' => blank($callout) && blank($heading),
    ])
>
    {{ $description }}
</div>

Steps To Reproduce

https://github.com/agentphoenix/class-directive-bug

View more
9 comments
agentphoenix

agentphoenix

21st Feb 2024 @ 02:24

enhancement confirmed ui low priority help wanted

Package

filament/filament

Package Version

3.2.35

Laravel Version

10.3.3

Livewire Version

3.4.6

PHP Version

8.3

Problem description

There's a pretty jarring visual glitch when using non-native select fields. This is what is shown while the field is loading:

It's very noticable for people on slow connections. See this video: https://www.youtube.com/watch?v=Ruax9OpgDmU

I understand that the js is lazy loaded (and that's great) but I think there should be a better placeholder while the field is still loading. Currently UI looks broken for several seconds for people on slow connections. It's also an issue when the server is far away from the user (eg. Australia -> Germany) regardless of connection speed.

The large white box with the dropdown arrow that shows while the field is loading isn't clickable either, which is even more confusing for users.

Expected behavior

Non-native select fields should have some kind of placeholder while Choices.js is loading to prevent them from looking broken.

Steps to reproduce

  1. Launch the reproduction repository
  2. Open the browser and throttle the connection to 2G
  3. Clear the browser cache, then open the create product page

The select will look broken for a few seconds.

Reproduction repository

https://github.com/binaryfire/filament-reproduction-repo

Relevant log output

No response

View more
5 comments πŸ‘€ 1
binaryfire

binaryfire

22nd Feb 2024 @ 02:36

bug unconfirmed low priority help wanted

Package

filament/spatie-laravel-translatable-plugin

Package Version

v3.2

Laravel Version

v10.10

Livewire Version

v3.0

PHP Version

PHP 8.2

Problem description

I have topic_id in Post & Articles connected with topic_id with relation topic, but when I tried to set locales for the Article & Post Title and other content that was added worked perfectly, but topic related data does not work I mean it does not change the translation When I tried to debug it is working perfectly but in view it does not change

Forms\Components\Select::make('topic_id')
    ->relationship('topic')
    ->getOptionLabelFromRecordUsing(function (Topic $topic, $livewire) {
        Log::info('Active Locale: ' . $livewire->activeLocale);

        $translatedTitle = $topic->getTranslation('title', $livewire->activeLocale);

        Log::info('Translated Title: ' . $translatedTitle);

        return $translatedTitle ?? $topic->title; // Fallback to default title if translation is not available
    })
    ->searchable()
    ->live()
    ->required(),
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Deserunt.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Incidunt sunt est animi.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Totam libero aspernatur est.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Et tempore voluptatum.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Nemo et sint.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Repellat consequatur dolores nostrum numquam.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Earum tenetur.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Aut sunt blanditiis blanditiis ut.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Provident vel.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Qui voluptas ut.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Sapiente ut exercitationem assumenda nesciunt.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Eveniet voluptatem consequuntur eum.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Ipsa ipsa dicta corrupti.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Qui veniam nulla ut earum.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: At asperiores consequuntur.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Ut.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Voluptatibus quisquam laboriosam eligendi dolores provident distinctio id deserunt.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Earum soluta.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Voluptatem voluptatibus dolores.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Rerum esse aut.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Dolore.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Quos modi illo est et molestiae.  
[2024-01-31 12:53:57] local.INFO: Active Locale: en  
[2024-01-31 12:53:57] local.INFO: Translated Title: Hic cum.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Eum et rerum.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Nihil voluptate voluptas est aliquid debitis qui doloremque non voluptate corporis.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Alias in consequuntur officiis.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Iste qui sunt omnis et eaque in.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Quas hic.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Incidunt animi perspiciatis natus doloremque commodi aut delectus.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Et ut.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Voluptatem qui inventore nobis itaque et magni.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Voluptatem libero.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Vero et modi veniam quidem.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Dolorum architecto ut deleniti repudiandae quidem sit non.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Rem dolorum rerum pariatur libero rerum.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Tempore distinctio autem commodi.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Ut sequi perferendis distinctio consequatur accusantium.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Esse hic eum saepe officiis sapiente.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Eveniet consectetur numquam architecto consectetur architecto quo nostrum.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Maiores qui ut non.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Blanditiis dolorum provident non suscipit.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Impedit sunt odio illo.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Ea reiciendis facere eligendi dignissimos voluptate architecto.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Quo corrupti ut illum.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Delectus eaque.  
[2024-01-31 12:54:05] local.INFO: Active Locale: ar  
[2024-01-31 12:54:05] local.INFO: Translated Title: Omnis dignissimos exercitationem praesentium.  

Expected behavior

It should have changed the select locale title

Steps to reproduce

  1. Installed Package filament/spatie-laravel-translatable-plugin

  2. Set up the Models and Migrations Accordingly: Article Model:

<?php

namespace App\Models;

use App\Concerns\HasMeta;
use App\Concerns\Sluggable;
use App\Concerns\HasFeaturedImage;
use App\Concerns\HasPublishedScope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Spatie\Translatable\HasTranslations;

class Article extends Model
{
    use HasPublishedScope, Sluggable, HasFactory, HasMeta, SoftDeletes, HasFeaturedImage, HasTranslations;

    public $translatable = ['title', 'content', 'excerpt'];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'title',
        'slug',
        'status',
        'author_id',
        'content',
        'excerpt',
        'published_at',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'published_at' => 'datetime',
        'content' => 'array',
    ];

    protected $with = [
        'meta',
    ];

    public function getPublicUrl()
    {
        return route('articles.show', $this);
    }

    public function topic(): BelongsTo
    {
        return $this->belongsTo(Topic::class, 'topic_id', 'id');
    }

    public function author(): BelongsTo
    {
        return $this->belongsTo(User::class, 'author_id');
    }
}

Topic Model:

<?php

namespace App\Models;

use App\Concerns\HasMeta;
use App\Concerns\Sluggable;
use App\Concerns\HasFeaturedImage;
use App\Concerns\HasPublishedScope;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Topic extends Model
{
    use HasPublishedScope, Sluggable, HasFactory, HasMeta, SoftDeletes, HasFeaturedImage, HasTranslations;

    public $translatable = ['title', 'content', 'excerpt'];
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'title',
        'slug',
        'status',
        'excerpt',
        'content',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'id' => 'integer',
        'indexable' => 'boolean',
        'content' => 'array',
    ];

    protected $with = [
        'meta',
    ];

    public function getPublicUrl()
    {
        return route('topics.show', $this);
    }

    public function articles()
    {
        return $this->hasMany(Article::class);
    }
}
  1. Generated the Resources and modified as per the instructions provided in the packages.

Images: English English Arabic Arabic

Reproduction repository

https://github.com/abbasmashaddy72/filament-starter-kit

Relevant log output

No response

View more
9 comments
abbasmashaddy72

abbasmashaddy72

31st Jan 2024 @ 07:42

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

v3.2

Laravel Version

v11

Livewire Version

No response

PHP Version

PHP 8.3

Problem description

If we configure the panel to use multiple domain, php artisan optimize fails

Unable to prepare route [admin/login] for serialization. Another route has already been assigned name [filament.admin.auth.login].

Expected behavior

We should be allowed to use multiple domains.

Steps to reproduce

  1. git clone https://github.com/declum/example-repo
  2. cp .env.example .env
  3. php artisan migrate --seed
  4. I have added two domains in Admin panel provider
  5. php artisan optimze

Reproduction repository

https://github.com/declum/example-repo

Relevant log output

No response

View more
5 comments
declum

declum

13th Mar 2024 @ 15:51

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

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

Server is down with 503 error when loading big pdf(8Mb, 40 pages). It's because you puting file in construct method Imagick.

$this->imagick = new Imagick($pdfFile);

But why whole file if i need only one page. In method getImageData there is instruction that page is need use for generate preview.

$this->imagick->readImage(sprintf('%s[%s]', $this->pdfFile, $this->page - 1));

If you need read all file don't indicate index of page. Like this:

$this->imagick->readImage($this->pdfFile);

After then i deleted file from constructor Imagick

$this->imagick = new Imagick();

And all works fine. If you want pick another page there is method setPage

View more
2 comments
truechernyshov

truechernyshov

11th Jan 2020 @ 10:59

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

bug unconfirmed low priority help wanted

Package

filament/filament

Package Version

v3.2.57

Laravel Version

v11.0.7

Livewire Version

v3.4.9

PHP Version

PHP 8.2.16

Problem description

I split my form in multi sections, in first one, Select and Datepicker are ->native(false)and ->live()to permit to see a third component (another Select) when values are set. When I choose an option on first Select, many errors occur in browser console

Alpine Expression Error: displayText is not defined...
Alpine Expression Error: focusedMonth is not defined...
Alpine Expression Error: months is not defined...
Alpine Expression Error: focusedYear is not defined...
Alpine Expression Error: dayLabels is not defined...
Alpine Expression Error: emptyDaysInFocusedMonth is not defined...
Alpine Expression Error: daysInFocusedMonth is not defined...

Same problem when I edit a record, when I change option, same errors appear

  • If I remove ->native(false) of all Datepicker, no errors but I need minDate, maxDate etc.
  • If I remove ->spa() in AdminPanelProvider, no errors
  • If I add, below ->spa()
->spaUrlExceptions(fn (): array => [
            url('/admin'),
            PostResource::getUrl(),
        ])

erros occur too

Expected behavior

No error should appears

Steps to reproduce

You can see this problem by cloning reproduction repository

Reproduction repository

https://github.com/agencetwogether/spa-datepicker

Relevant log output

No response

View more
1 comment
agencetwogether

agencetwogether

20th Mar 2024 @ 21:22

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

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

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

krisc78

9th Mar 2023 @ 14:49

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

bug unconfirmed low priority help wanted

Package

filament/actions

Package Version

v3.2.60

Laravel Version

v10.48.4

Livewire Version

v3.4.9

PHP Version

PHP 8.3.3

Problem description

When I try to import a CSV file encoded with ISO-8859-1, the columns are not mapped although I set up it in the getColumns method.

public static function getColumns(): array
    {
        return [
            ImportColumn::make('name')
                ->guess(['Açaí'])
                ->requiredMapping()
                ->rules(['required', 'max:255']),
            ...
      ]
}

image

Even selecting the correct columns in the interface, I get the exception Unable to encode attribute [data] for model [Filament\Actions\Imports\Models\FailedImportRow] to JSON: Malformed UTF-8 characters, possibly incorrectly encoded.

Also, I noticed that the row data has the same issue. The expected output should be Conceição instead of Conceio.

image

In this case, for test purposes, I am able to fix the row data by updating the method Filament\Actions\Imports\Jobs\ImportCsv::utf8Encode from

if (is_string($value)) {
     return mb_convert_encoding($value, 'UTF-8', 'UTF-8');
}

to

if (is_string($value)) {
     return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
}

image

But the title column remains with the issue and I am not able to import.

Other than that, I converted my test file to UTF-8 (iconv -f ISO-8859-1 -t utf-8 input-ISO-8859-1.csv -o input-utf8.csv) and it works as expected.

Expected behavior

I expect that the Filament handles CSV files that are not encoded with UTF-8.

Steps to reproduce

  1. Create an import action
  2. Update the getColumns method and add the method guess()
  3. Upload a CSV file encoded with ISO-8859-1 (there is an example in the reproduction repository called input-ISO-8859-1.csv in the project's root). At least one title should have a character like Γ§, Γ­ and Γ£.
  4. Try to import

Reproduction repository

https://github.com/Rahmon/filamentphp-issues

Relevant log output

Unable to encode attribute [data] for model [Filament\Actions\Imports\Models\FailedImportRow] to JSON: Malformed UTF-8 characters, possibly incorrectly encoded. {"userId":1,"exception":"[object] (Illuminate\\Database\\Eloquent\\JsonEncodingException(code: 0): Unable to encode attribute [data] for model [Filament\\Actions\\Imports\\Models\\FailedImportRow] to JSON: Malformed UTF-8 characters, possibly incorrectly encoded. at /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php:47)
[stacktrace]
#0 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(1292): Illuminate\\Database\\Eloquent\\JsonEncodingException::forAttribute()
#1 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(1024): Illuminate\\Database\\Eloquent\\Model->castAttributeAsJson()
#2 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2243): Illuminate\\Database\\Eloquent\\Model->setAttribute()
#3 /tmp/filament-issue/vendor/filament/actions/src/Imports/Jobs/ImportCsv.php(133): Illuminate\\Database\\Eloquent\\Model->__set()
#4 /tmp/filament-issue/vendor/filament/actions/src/Imports/Jobs/ImportCsv.php(86): Filament\\Actions\\Imports\\Jobs\\ImportCsv->logFailedRow()
#5 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Filament\\Actions\\Imports\\Jobs\\ImportCsv->handle()
#6 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#8 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#9 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#10 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#11 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#12 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#14 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Bus\\Dispatcher->dispatchNow()
#15 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#16 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Middleware/WithoutOverlapping.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Queue\\Middleware\\WithoutOverlapping->handle()
#18 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#20 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#21 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\\Queue\\CallQueuedHandler->call()
#22 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\\Queue\\Jobs\\Job->fire()
#23 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\\Queue\\Worker->process()
#24 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(333): Illuminate\\Queue\\Worker->runJob()
#25 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(139): Illuminate\\Queue\\Worker->runNextJob()
#26 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(122): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#27 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#28 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#29 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#30 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#31 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#32 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Console/Command.php(212): Illuminate\\Container\\Container->call()
#33 /tmp/filament-issue/vendor/symfony/console/Command/Command.php(279): Illuminate\\Console\\Command->execute()
#34 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\\Component\\Console\\Command\\Command->run()
#35 /tmp/filament-issue/vendor/symfony/console/Application.php(1049): Illuminate\\Console\\Command->run()
#36 /tmp/filament-issue/vendor/symfony/console/Application.php(318): Symfony\\Component\\Console\\Application->doRunCommand()
#37 /tmp/filament-issue/vendor/symfony/console/Application.php(169): Symfony\\Component\\Console\\Application->doRun()
#38 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(196): Symfony\\Component\\Console\\Application->run()
#39 /tmp/filament-issue/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1183): Illuminate\\Foundation\\Console\\Kernel->handle()
#40 /tmp/filament-issue/artisan(13): Illuminate\\Foundation\\Application->handleCommand()
#41 {main}
View more
1 comment
Rahmon

Rahmon

27th Mar 2024 @ 21:25

bug help wanted

Laravel Version

11.0.7

PHP Version

8.3.4

Database Driver & Version

No response

Description

As found out in #50120 - the php artisan schedule:list is broken for fluent-style scheduling entries.

The scheduling still works as expected, but the list is displayed incorrectly.

Using the example from the docs (https://laravel.com/docs/11.x/scheduling#between-time-constraints):

$schedule->command('emails:send')
      ->hourly()
      ->between('7:00', '22:00');

php artisan schedule:list:

  0 * * * *    php artisan emails:send ......................... Next Due: in 8 Minutes

As you can see the configuration is displayed as a seemingly random value, in this case just hourly.

Related Laracasts topic:

https://laracasts.com/discuss/channels/laravel/schedule-between-not-working-as-expected

Steps To Reproduce

add

$schedule->command('emails:send')
      ->hourly()
      ->between('7:00', '22:00');

to routes/console.php and launch

php artisan schedule:list
View more
11 comments
raveren

raveren

20th Mar 2024 @ 10:50

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

bug help wanted

Laravel Version

10.10

PHP Version

8.2.14

Database Driver & Version

PostgreSQL 15.1 (Ubuntu 15.1-1.pgdg20.04+1)

Description

A ManyToMany relationship in which one or more parties casts the id column to an Enum will cause Illuminate\Database\Query\Builder::whereIntegerInRaw() to throw an ErrorException because it tries to cast the (already cast to an enum) id on the model to an int. However, Enums are NOT castable in PHP (I tried php 8.1 up to 8.3).

Steps To Reproduce

A minimal reproducible example is available here.

In the MRE repo are three models: User, Role, and a pivot RoleUser. A regular ManyToMany relationship is defined between User and Role through the RoleUser pivot. Role's id column is an integer column that is cast to the backed enum App\Enum\Roles. Similarly, inside the pivot RoleUser, role_id is also cast to the same enum.

With this setup, running the following query Role::with('users')->get(); throws an ErrorException with the message "Object of class App\Enums\Roles could not be converted to int", in Illuminate\Database\Query\Builder::whereIntegerInRaw(), line 1164.

EDIT: The fact that the concerned column is autoincrement or not has no incidence on the issue. I have updated various sections of this issue to reflect this.

View more
6 comments πŸ‘ 1
galactic-interloper

galactic-interloper

18th Jan 2024 @ 15:59

bug unconfirmed help wanted medium priority

Package

filament/filament

Package Version

v3.2.6

Laravel Version

v10.41.0

Livewire Version

v3.0.0.0

PHP Version

PHP 8.2.11

Problem description

When opening a nested modal, scroll lock is lost on the backdrop, allowing you to scroll the backdrop. After closing the nested modal (using the cancel button, x icon, or clicking off the modal) scroll lock is resumed on the backdrop. After closing the parent (or first) modal, page scrolling becomes disabled until refreshing the page or navigating away.

There are no console errors and this problem seems to occur on all browsers when using npm run dev or npm run build with vite.

Expected behavior

When opening a nested modal (or slide-over), scroll lock on the backdrop should not be lost. After closing all modals, you should be able to resume scrolling the page without having to refresh or navigate away.

Steps to reproduce

  1. Install the reproduction repository locally
  2. Run composer install
  3. Run the migrations and seeders php artisan migrate --seed
  4. Create a filament user php artisan make:filament-user
  5. Run npm run build
  6. Login using your credentials /admin/login
  7. Navigate to the orders table and set the number of visible order to "all" so that the page scrolls
  8. Click "New order"
  9. Click "+" suffix action on either the product or customer input
  10. Observe the backdrop scrolls
  11. Close all modals
  12. Observe the page won't scroll
  13. Observer no console errors
  14. Refresh the page and observe the page is scrollable again

Reproduction repository

https://github.com/nkeena/filament-modal-bug

Relevant log output

No response

View more
8 comments πŸ‘ 2
nkeena

nkeena

19th Jan 2024 @ 14: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

After reflecting upon it I believe it's better to keep the language strings in the places where's they're used. This keeps a smaller footprint and easier way to edit them without having to move through different language files.

So how this would go is that we need to replace the keys with their actual language strings:

$this->success('settings.deleted');

Becomes

$this->success('Account was successfully removed.');

Additionally, SendsAlerts should be updated to use the __() helper instead of the obsolete trans helper.

Lastly, all language files, including its directory should be removed. It's not needed to add an en.json language file because it's highly unlikely we'll ever offer multi language support for Laravel.io

View more
driesvints

driesvints

27th Mar 2024 @ 08:46

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 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