-
-
Save cursosdesarrolloweb/e4bb5638c0dfc656af18ae7b51c8325b 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\Events\NewOrder; | |
use App\Models\Order; | |
use Illuminate\Support\Facades\Route; | |
use Illuminate\Support\Facades\Event; | |
Route::get("/order/process", function () { | |
$order = Order::create([ | |
"user_id" => auth()->id(), | |
"amount" => 99.9, | |
"status" => OrderStatus::Processed, | |
"created_at" => now(), | |
]); | |
Event::dispatch(new NewOrder($order)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment