project->approvalWorkflow; $currentStep = $workflow->getCurrentStep($document); $document->approvals()->create([ 'user_id' => auth()->id(), 'status' => 'pending', 'step_index' => 0, 'required_role' => $currentStep['role'] ]); Notification::sendUsersWithRole($currentStep['role'])->notify( new ApprovalRequestNotification($document, $auth()->user()) ); } }