Implement chat support functionality: update .env.example for Reverb integration, enhance ChatController with support conversation methods, and modify Conversation model for improved chat handling. Add middleware for chat operator checks and update broadcasting configuration for Reverb.
This commit is contained in:
18
app/Http/Middleware/EnsureChatOperator.php
Normal file
18
app/Http/Middleware/EnsureChatOperator.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\ChatSupport;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class EnsureChatOperator
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
abort_unless(ChatSupport::isOperator($request->user()), 403);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user