Skip to content

ExampleJob and Queueable define the same property ($group) #56895

@ryzr

Description

@ryzr

Laravel Version

12.27.0

PHP Version

8.4

Database Driver & Version

N/A

Description

See: #56763

Adding the $group property to Queueable has broken existing Jobs that also define this property.

Caution

App\Jobs\ExampleJob and Illuminate\Bus\Queueable define the same property ($group) in the composition of App\Jobs\ExampleJob. However, the definition differs and is considered incompatible. Class was composed

Obviously there will have to be some property name used here, but maybe we could agree on a term less common than $group?

Or we move it to a new trait?

Steps To Reproduce

<?php

namespace App\Jobs;

use App\Models\Group;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;

class ExampleJob implements ShouldQueue
{
    use Queueable;

    public function __construct(public Group $group) {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions