Created
October 29, 2022 03:36
-
-
Save rmcdaniel/9045dc570047ab663e217efada92a6d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Workflows\VerifyEmail\VerifyEmailWorkflow; | |
use Illuminate\Support\Facades\Hash; | |
use Illuminate\Support\Facades\Route; | |
use Workflow\WorkflowStub; | |
Route::get('/register', function () { | |
$workflow = WorkflowStub::make(VerifyEmailWorkflow::class); | |
$workflow->start( | |
'test+1@example.com', | |
Hash::make('password'), | |
); | |
return response()->json([ | |
'workflow_id' => $workflow->id(), | |
]); | |
}); | |
Route::get('/verify-email', function () { | |
$workflow = WorkflowStub::load(request('workflow_id')); | |
$workflow->verify(); | |
return response()->json('ok'); | |
})->name('verify-email'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment