From c566bf9c27b4e197d745c038ba5ccf1787526fda Mon Sep 17 00:00:00 2001 From: UronShrestha Date: Wed, 10 Jul 2024 13:46:42 +0545 Subject: [PATCH] ChatBot Integration --- app/Http/Controllers/BotManController.php | 57 ++ app/Http/Controllers/MainController.php | 46 +- app/Mail/Testing.php | 54 ++ app/Models/UserChat.php | 11 + composer.json | 2 + composer.lock | 743 +++++++++++++++++- config/botman/config.php | 6 + config/botman/web.php | 7 + ...24_07_10_070509_create_user_chat_table.php | 30 + public/img/icon/chatbot.png | Bin 0 -> 475 bytes resources/views/Mails/testing.blade.php | 21 + resources/views/components/footer.blade.php | 16 +- resources/views/components/header.blade.php | 10 + resources/views/shop.blade.php | 2 +- routes/web.php | 8 + 15 files changed, 986 insertions(+), 27 deletions(-) create mode 100644 app/Http/Controllers/BotManController.php create mode 100644 app/Mail/Testing.php create mode 100644 app/Models/UserChat.php create mode 100644 config/botman/config.php create mode 100644 config/botman/web.php create mode 100644 database/migrations/2024_07_10_070509_create_user_chat_table.php create mode 100644 public/img/icon/chatbot.png create mode 100644 resources/views/Mails/testing.blade.php diff --git a/app/Http/Controllers/BotManController.php b/app/Http/Controllers/BotManController.php new file mode 100644 index 0000000..5903ad3 --- /dev/null +++ b/app/Http/Controllers/BotManController.php @@ -0,0 +1,57 @@ +hears('{message}', function ($botman, $message) { + if ($message == 'hi' || $message == 'Hi' || $message == 'Hello' || $message == 'hello') { + $this->askName($botman); + } else { + $botman->reply("Start the conversation saying Hi."); + } + }); + $botman->listen(); + } + public function askName($botman) + { + $botman->ask('Hello! What is your name?', function (Answer $answer, $conversation) { + $name = $answer->getText(); + $this->say("Nice to meet you " . $name); + + + + $conversation->ask('Can you tell us your phone number?', function (Answer $answer, $conversation) { + $phoneNumber = $answer->getText(); + $this->say("Your phone number is " . $phoneNumber); + + + $conversation->ask('Can you tell us your email?', function (Answer $answer, $conversation) { + $email = $answer->getText(); + $this->say("Your email is " . $email); + + $conversation->ask('Confirm your Email (Y/N):', function (Answer $answer, $conversation) { + $confirmEmail = $answer->getText(); + if ($answer == 'Y' || $answer == "y") { + $this->say("we got your details"); + } elseif ($answer == 'N' || $answer == "n") { + $this->say("Please confirm your email"); + $conversation->ask('Write your email again.', function (Answer $answer, $conversation) { + $email = $answer->getText(); + $this->say("Your email is " . $email); + }); + } + }); + }); + }); + }); + } +} diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 278ac04..37575a9 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Mail\Testing; use App\Models\User; use Illuminate\Support\Facades\DB; @@ -12,6 +13,8 @@ use App\Models\Order; use App\Models\OrderItem; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; +use Illuminate\Support\Facades\Mail; + class MainController extends Controller { @@ -188,34 +191,22 @@ class MainController extends Controller public function myOrders() { - $customerId = auth()->id(); // Assuming you are using authentication - $orders = Order::where('customerId', session()->get('id'))->get(); + if (session()->has('id')) { + $orders = Order::where('customerId', session()->get('id'))->get(); + $items = DB::table('products') - $items = DB::table('products') - ->join('order_items', 'order_items.productId', '=', 'products.id') - ->select('products.name', 'products.picture', 'products.price', 'order_items.quantity', 'order_items.orderId as order_id') - ->whereIn('order_items.orderId', $orders->pluck('id')) - ->get(); - return view('orders', compact('orders', 'items')); + ->join('order_items', 'order_items.productId', '=', 'products.id') + ->select('products.name', 'products.picture', 'products.*') + ->get(); + + return view('orders', compact('orders', 'items')); + } + + return view('login'); } - // public function myOrders() - // { - // $customerId = auth()->id(); // Assuming you are using authentication - // $orders = Order::where('customerId', session()->get('id'))->get(); - - // $items = DB::table('products') - // ->join('order_items', 'order_items.productId', '=', 'products.id') - // ->select('products.name', 'products.picture', 'products.price', 'order_items.quantity', 'order_items.orderId as order_id') - // ->whereIn('order_items.orderId', $orders->pluck('id')) - // ->get(); - - // return view('orders', compact('orders', 'items')); - // } - - public function profile() { if (session()->has('id')) { @@ -283,6 +274,15 @@ class MainController extends Controller return view('checkout'); } + public function testMail() + { + $details = [ + 'title' => 'Mail from Uron Shrestha', + 'message' => 'This is for testing mail using smtp in Laravel!' + ]; + Mail::to("yuron.stha57@gmail.com")->send(new Testing($details)); + return redirect('/'); + } public function shop() diff --git a/app/Mail/Testing.php b/app/Mail/Testing.php new file mode 100644 index 0000000..7bcfb6a --- /dev/null +++ b/app/Mail/Testing.php @@ -0,0 +1,54 @@ +details = $details; + } + + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: 'Testing', + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + view: 'Mails.testing', + ); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments(): array + { + return []; + } +} diff --git a/app/Models/UserChat.php b/app/Models/UserChat.php new file mode 100644 index 0000000..40eaa17 --- /dev/null +++ b/app/Models/UserChat.php @@ -0,0 +1,11 @@ +=7.1", + "psr/container": "^1.0 || ^2.0", + "react/socket": "~1.0", + "spatie/macroable": "^1.0", + "symfony/http-foundation": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "require-dev": { + "codeigniter/framework": "~3.0", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "^1.6", + "ext-curl": "*", + "mockery/mockery": "^1.1", + "orchestra/testbench": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0", + "symfony/cache": "^3.4.35 || ^4.3.7 || ^5.0" + }, + "suggest": { + "doctrine/cache": "Use any Doctrine cache driver for cache", + "symfony/cache": "Use any Symfony cache driver for cache" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + }, + "laravel": { + "providers": [ + "BotMan\\BotMan\\BotManServiceProvider" + ], + "aliases": { + "BotMan": "BotMan\\BotMan\\Facades\\BotMan" + } + } + }, + "autoload": { + "psr-4": { + "BotMan\\BotMan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "m.pociot@gmail.com" + } + ], + "description": "Create messaging bots in PHP with ease.", + "homepage": "http://github.com/botman/botman", + "keywords": [ + "Botman", + "bot", + "chatbot" + ], + "support": { + "issues": "https://github.com/botman/botman/issues", + "source": "https://github.com/botman/botman/tree/v2.8.3" + }, + "time": "2024-03-13T07:59:56+00:00" + }, + { + "name": "botman/driver-web", + "version": "v1.5.3", + "source": { + "type": "git", + "url": "https://github.com/botman/driver-web.git", + "reference": "45b3bde9c5af0f52d9a893a3793740e3304015af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/botman/driver-web/zipball/45b3bde9c5af0f52d9a893a3793740e3304015af", + "reference": "45b3bde9c5af0f52d9a893a3793740e3304015af", + "shasum": "" + }, + "require": { + "botman/botman": ">=2.0", + "php": ">=7.0" + }, + "require-dev": { + "botman/driver-facebook": "~2.0", + "botman/studio-addons": "~1.0", + "ext-curl": "*", + "illuminate/support": "~5.5.0", + "mockery/mockery": "^1.1", + "phpunit/phpunit": "~5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + }, + "laravel": { + "providers": [ + "BotMan\\Drivers\\Web\\Providers\\WebServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "BotMan\\Drivers\\Web\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "m.pociot@gmail.com" + } + ], + "description": "Web driver for BotMan", + "homepage": "http://github.com/botman/driver-web", + "keywords": [ + "Botman", + "bot", + "web" + ], + "support": { + "issues": "https://github.com/botman/driver-web/issues", + "source": "https://github.com/botman/driver-web/tree/v1.5.3" + }, + "time": "2022-05-01T20:39:28+00:00" + }, { "name": "brick/math", "version": "0.12.1", @@ -506,6 +651,53 @@ ], "time": "2023-10-06T06:47:41+00:00" }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.3.0", @@ -1916,6 +2108,54 @@ ], "time": "2024-06-28T09:40:51+00:00" }, + { + "name": "mpociot/pipeline", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/mpociot/pipeline.git", + "reference": "3584db4a0de68067b2b074edfadf6a48b5603a6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpociot/pipeline/zipball/3584db4a0de68067b2b074edfadf6a48b5603a6b", + "reference": "3584db4a0de68067b2b074edfadf6a48b5603a6b", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpociot\\Pipeline\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcel Pociot", + "email": "m.pociot@gmail.com" + } + ], + "description": "Simple PHP middleware pipeline", + "homepage": "http://github.com/mpociot/pipeline", + "keywords": [ + "middleware", + "pipeline" + ], + "support": { + "issues": "https://github.com/mpociot/pipeline/issues", + "source": "https://github.com/mpociot/pipeline/tree/1.0.2" + }, + "time": "2017-04-21T13:22:05+00:00" + }, { "name": "nesbot/carbon", "version": "3.6.0", @@ -3107,6 +3347,507 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.11", + "react/event-loop": "^1.2", + "react/promise": "^3 || ^2.6 || ^1.2.1", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4 || ^3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.15.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-12-15T11:02:10+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "spatie/macroable", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/macroable.git", + "reference": "7a99549fc001c925714b329220dea680c04bfa48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/macroable/zipball/7a99549fc001c925714b329220dea680c04bfa48", + "reference": "7a99549fc001c925714b329220dea680c04bfa48", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Macroable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A trait to dynamically add methods to a class", + "homepage": "https://github.com/spatie/macroable", + "keywords": [ + "macroable", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/macroable/issues", + "source": "https://github.com/spatie/macroable/tree/1.0.1" + }, + "time": "2020-11-03T10:15:05+00:00" + }, { "name": "stripe/stripe-php", "version": "v15.1.0", diff --git a/config/botman/config.php b/config/botman/config.php new file mode 100644 index 0000000..03b3738 --- /dev/null +++ b/config/botman/config.php @@ -0,0 +1,6 @@ + 40, + 'user_cache_time' => 30, +]; diff --git a/config/botman/web.php b/config/botman/web.php new file mode 100644 index 0000000..aa7b3d3 --- /dev/null +++ b/config/botman/web.php @@ -0,0 +1,7 @@ + [ + 'driver' => 'web', + ], +]; diff --git a/database/migrations/2024_07_10_070509_create_user_chat_table.php b/database/migrations/2024_07_10_070509_create_user_chat_table.php new file mode 100644 index 0000000..237cfe7 --- /dev/null +++ b/database/migrations/2024_07_10_070509_create_user_chat_table.php @@ -0,0 +1,30 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->string('phone'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('userChat'); + } +}; diff --git a/public/img/icon/chatbot.png b/public/img/icon/chatbot.png new file mode 100644 index 0000000000000000000000000000000000000000..961aab972edd5363e439cbf3eaf8ebf356b48824 GIT binary patch literal 475 zcmV<10VMv3P)u)&htFy*L`oL zwOz*>bhp62W9|&S72G`oAHhzAwy5&8Abi0!JjKNVJH}%iwBsGd@D@*MDlOwu5&MZh z&>mG@;ZBQIAK-Ek`;Db$g8TS@(Ex`qjIQvX<3f?(7yja;LWeYOKjtIBM@&hJx*eR- zZlWtsuz(Xh!oP@hMt6sqa45!piPvxiKk%)nG=ZL)%ALV|fvd2EXV}b04}+MCW;1^? zG<(pHw!D!M*3g^zy%B5LMrayssA}4r#(w7SN36687Ne!z0vyL`oLdF97n=8Q4t?0h zKt?(*U2T7SH*GMuebO^HwR`w1y~4V&D%`+2W@>PxpXZab*rVb!q(x5Vg8zNMN4OuL R-**52002ovPDHLkV1hU6%^d&$ literal 0 HcmV?d00001 diff --git a/resources/views/Mails/testing.blade.php b/resources/views/Mails/testing.blade.php new file mode 100644 index 0000000..f574170 --- /dev/null +++ b/resources/views/Mails/testing.blade.php @@ -0,0 +1,21 @@ + + + + + + + + Document + + + +

+ {{ $details['title'] }} +

+

+ {{ $details['message'] }} +

+ + + + diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php index 8f0feb6..bfa58cf 100644 --- a/resources/views/components/footer.blade.php +++ b/resources/views/components/footer.blade.php @@ -91,6 +91,18 @@ +{{-- Botman --}} + + +{{-- Botman Script --}} + @@ -110,14 +122,14 @@ if (successMessage) { successMessage.style.display = 'none'; } - }, 2000); // 3000 milliseconds = 3 seconds + }, 2000); setTimeout(function() { var errorMessage = document.getElementById('error-message'); if (errorMessage) { errorMessage.style.display = 'none'; } - }, 2000); // 2000 milliseconds = 3 seconds + }, 2000); }); diff --git a/resources/views/components/header.blade.php b/resources/views/components/header.blade.php index 676e235..8da3221 100644 --- a/resources/views/components/header.blade.php +++ b/resources/views/components/header.blade.php @@ -30,6 +30,11 @@ + + {{-- botman --}} + {{-- --}} + @@ -135,6 +140,9 @@
  • Check Out
  • My Orders
  • Profile
  • +
  • Email
  • + + @@ -144,6 +152,8 @@
    + {{-- --}} diff --git a/resources/views/shop.blade.php b/resources/views/shop.blade.php index d53b75b..353582e 100644 --- a/resources/views/shop.blade.php +++ b/resources/views/shop.blade.php @@ -7,7 +7,7 @@ diff --git a/routes/web.php b/routes/web.php index 0c80ebb..7167c9e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,7 +1,9 @@ group(function () { Route::get('stripe', 'stripe'); Route::post('stripe', 'stripePost')->name('stripe.post'); }); + +// Route::get('/testMail', [MainController::class, 'testMail'])->name('testMail'); +Route::get('/testMail', [MainController::class, 'testMail'])->name('testMail'); + + +Route::match(['get', 'post'], '/botman', [BotManController::class, 'handle'])->name('botman');