Skip to content

Commit 40931bb

Browse files
committed
add open ai key in env
1 parent ed4e8e5 commit 40931bb

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ AWS_DEFAULT_REGION=us-east-1
4343
AWS_BUCKET=
4444
AWS_USE_PATH_STYLE_ENDPOINT=false
4545

46+
OPEN_API_KEY=
47+
4648
PUSHER_APP_ID=
4749
PUSHER_APP_KEY=
4850
PUSHER_APP_SECRET=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Api;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\StoreBankConfigRequest;
7+
use App\Models\BankConfig;
8+
use App\Utils\RandomHelper;
9+
use Illuminate\Http\Request;
10+
11+
class ChatBotController extends Controller
12+
{
13+
public function __invoke(Request $request) {
14+
return response()->json("Hello, I'm ChatBot");
15+
}
16+
}

routes/api.php

+3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
*/
1818

1919
Route::prefix('/v1')->group(function () {
20+
Route::post('/chat', [\App\Http\Controllers\Api\ChatBotController::class, '__invoke']);
21+
2022
Route::middleware(['auth:sanctum'])->group(function () {
2123
Route::middleware(['checkAdmin'])->group(function () {
24+
2225
Route::post('/products', [\App\Http\Controllers\Api\ProductController::class, 'store']);
2326
Route::put('/products/{product}', [\App\Http\Controllers\Api\ProductController::class, 'update']);
2427
Route::delete('/products/bulk-delete', [\App\Http\Controllers\Api\ProductController::class, 'destroyMultiple']);

0 commit comments

Comments
 (0)