Open garissman opened 3 years ago
Same problem! Try on MongoDB and MySQL.
Same problem here:
The same issue in Laravel 8.53.1 because of $batch is array but trying to get id like object
if make this fix to test
$batch = (object)$batch;
than got next error in vendor/laravel/framework/src/Illuminate/Bus/PendingBatch.php
Hi @stadeleon, in order to fix this issue this PR #1904 has to be merge
Bus::batch will not work with MongoDB.
Currently not supporting, may be in feature releases.
has this already been resolved?
Is any progress about this issue?
Same :(
Is any progress about this issue?
Try to extend that DatabaseBatchRepository in providers by creating custom class with redeclared find() method
Hello, this problem still persists. Is there any update?
Laravel version: 8.83.23 PHP version: 8.1.6 Laravel-mongodb Version: v3.8.1 Database Driver & Version: jenssegers/mongodb v3.8.1
Is there any update for batching ? i've try hybrid using mysql for batches only. What i do is i change the config of queue where there is a batch array says 'batching' . It work for creating the batch, but im not sure all the queue goes to mongodb instead. Really need batching to be worked!
I see a couple of problems using the default DatabaseBatchRepository
class:
id
for its primary key, but MongoDB uses _id
. This makes all queries on id
unindexedid
property to have no unique constraint unless people run a migration for that collection->table()
call uses a type map specifying arrays for root documents and embedded documents. This causes the issue of receiving an array when the repository expects an object. However, this is not something we can generally change.With that in mind, the solution will most likely involve creating a separate repository class that doesn't have the issues mentioned above.
I've created PHPORM-81 to track this internally.
same :( this issue opened 2020 and now 2024. Pls fix it. We cant make batch on MongoDB how to do this? Why laravel doesnt focus to mongodb ?
Description:
Trying to get property 'id' of non-object on vendor/laravel/framework/src/Illuminate/Bus/DatabaseBatchRepository.php:256
Steps to reproduce
$batch = Bus::batch([ new ProcessPodcast(Podcast::find(1)), new ProcessPodcast(Podcast::find(2)), new ProcessPodcast(Podcast::find(3)), new ProcessPodcast(Podcast::find(4)), new ProcessPodcast(Podcast::find(5)), ])->then(function (Batch $batch) { // All jobs completed successfully... })->catch(function (Batch $batch, Throwable $e) { // First batch job failure detected... })->finally(function (Batch $batch) { // The batch has finished executing... })->dispatch();
Actual behaviour
in Illuminate\Bus\DatabaseBatchRepository::find
Thanks