Level 122
why would you write it this way?
I want to know at what point do laravel dispatch the job?
$job = ThisIsTheJob::dispatch($user); // Do laravel dispatch the job here?
$job->afterCommit(); // But I have after commit here
I have tested this already and when I wrap this on DB::transaction its dispatching after commit, if it doesn't it dispatches immediately.
I'm just wondering how ->afterCommit() works, because what I know is it's already dispatching on this line ThisIsTheJob::dispatch($user), and how do it know if afterCommit is being called on the next line?
Please or to participate in this conversation.