clrghouz/app/Http/Controllers/MatrixController.php

23 lines
538 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use App\Events\Matrix\Factory as MatrixEventFactory;
final class MatrixController extends Controller
{
private const LOGKEY = 'CMC';
public function webhook(Request $request)
{
$event = MatrixEventFactory::make(Arr::get($request->events,0,[]));
Log::info(sprintf('%s:- Dispatching Matrix Event [%s]',static::LOGKEY,get_class($event)));
event($event);
return response(['result'=>'OK']);
}
}