Skip to content

No longer able to batch a closure. #54586

@roblesterjr04

Description

@roblesterjr04

Laravel Version

11.42.*

PHP Version

8.3.16

Database Driver & Version

using sail - so whatever version comes packaged.

Description

After upgrading to the latest version of laravel/framework, previously working batch code now produces this error: Attempted to batch job [Closure], but it does not use the Batchable trait.

Image

Reverting to version 11.41.* allowed the capability back. If this change was intended, please document it. I batch a few simple operations that don't merit their own entire job class.

Steps To Reproduce

Upgrade to framework version 11.42

$batch = Bus::batch([
    function() use ($model) {
        // do something with your model
    }
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions