ChatBot Integration
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user