feat/reverb (#20)
Co-authored-by: jon brookes <marshyon@gmail.com> Reviewed-on: https://codeberg.org/headshed/share-lt/pulls/20
This commit is contained in:
parent
74bc17d019
commit
21147af908
30 changed files with 1948 additions and 29 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Http\Controllers\CategoryController;
|
||||
use App\Http\Controllers\EntryController;
|
||||
use App\Http\Controllers\NotificationController;
|
||||
use App\Http\Controllers\TextWidgetController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
|
@ -23,4 +24,6 @@ Route::middleware('auth:sanctum')->group(function () {
|
|||
Route::get('/text-widgets/{textWidget}', [TextWidgetController::class, 'show']);
|
||||
Route::put('/text-widgets/{textWidget}', [TextWidgetController::class, 'update']);
|
||||
Route::delete('/text-widgets/{textWidget}', [TextWidgetController::class, 'destroy']);
|
||||
|
||||
Route::post('/notifications/preview-site-built', [NotificationController::class, 'sendPreviewSiteBuilt']);
|
||||
});
|
||||
|
|
|
|||
7
routes/channels.php
Normal file
7
routes/channels.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
});
|
||||
|
|
@ -32,4 +32,20 @@ Route::middleware(['auth'])->group(function () {
|
|||
),
|
||||
)
|
||||
->name('two-factor.show');
|
||||
|
||||
Route::get('/test-reverb', function () {
|
||||
event(new App\Events\TestEvent('Hello from Laravel at ' . now()));
|
||||
|
||||
return 'Event fired! Check your browser console.';
|
||||
})->name('test.reverb');
|
||||
|
||||
Route::get('/test-reverb-page', function () {
|
||||
return view('test-reverb');
|
||||
})->name('test.reverb.page');
|
||||
|
||||
Route::get('/test-preview-site-built', function () {
|
||||
event(new App\Events\PreviewSiteBuilt('Preview site is built at ' . now(), 'success'));
|
||||
|
||||
return 'Preview site built notification sent! Check your Filament admin panel for the toast notification.';
|
||||
})->name('test.preview.site.built');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue