diff --git a/app/Http/Controllers/WelcomeController.php b/app/Http/Controllers/WelcomeController.php index 247dcee..d02d30c 100644 --- a/app/Http/Controllers/WelcomeController.php +++ b/app/Http/Controllers/WelcomeController.php @@ -2,9 +2,17 @@ namespace App\Http\Controllers; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; + class WelcomeController extends Controller { public function home() { return view('welcome.home'); } + + public function webhook(Request $request) + { + Log::channel('webhook')->debug('Webhook event',['request'=>$request]); + } } \ No newline at end of file diff --git a/config/logging.php b/config/logging.php index 91dd4c3..8a2875b 100644 --- a/config/logging.php +++ b/config/logging.php @@ -54,6 +54,12 @@ return [ 'days' => 14, ], + 'webhook' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/webhook.log'), + 'level' => env('LOG_LEVEL', 'debug'), + ], + 'slack' => [ 'driver' => 'slack', 'url' => env('LOG_SLACK_WEBHOOK_URL'), diff --git a/routes/api.php b/routes/api.php index 0d62f40..e0f8f21 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,6 +1,10 @@ ['auth:api','role:reseller']], function() { Route::group(['middleware'=>'auth:api'], function() { Route::post('/u/checkout/fee/{o}',[CheckoutController::class,'fee']) ->where('o','[0-9]+'); -}); \ No newline at end of file +}); + +Route::any('/intuit/webhook',[WelcomeController::class,'webhook']) + ->where('o','[0-9]+'); \ No newline at end of file