user(); if ($request->has('send_email') && $request->get('send_email') && $request->missing('output')) { SendToAdmin::dispatch($user->company(), $request->all(), ProfitLoss::class, $this->filename); return response()->json(['message' => 'working...'], 200); } $hash = \Illuminate\Support\Str::uuid(); PreviewReport::dispatch($user->company(), $request->all(), ProfitLoss::class, $hash); return response()->json(['message' => $hash], 200); } }