-- https://www.phpmyadmin.net/
--

START TRANSACTION;



-- --------------------------------------------------------

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `name` text DEFAULT NULL,
  `image` text DEFAULT NULL,
  `cat_type` varchar(50) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `image`, `cat_type`, `created_at`, `updated_at`) VALUES
(25, 'Pizza', '1719663131pizza.jpg', 'food', '2024-06-29 19:12:11', '2024-06-29 19:12:11'),
(26, 'Burger', '1719663147burger.jpg', 'food', '2024-06-29 19:12:27', '2024-06-29 19:12:27'),
(28, 'Pasta', '1722579361chese pasta.webp', 'food', '2024-08-02 10:16:01', '2024-08-02 10:16:01'),
(29, 'biryani', '1722585220hydbiryani.jpeg', 'food', '2024-08-02 11:53:40', '2024-08-02 11:53:40');

-- --------------------------------------------------------

--
-- Table structure for table `contactus`
--

CREATE TABLE `contactus` (
  `id` int(11) NOT NULL,
  `name` text NOT NULL,
  `email` text NOT NULL,
  `subject` text DEFAULT NULL,
  `message` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contactus`
--

INSERT INTO `contactus` (`id`, `name`, `email`, `subject`, `message`, `created_at`, `updated_at`) VALUES
(106, 'Zubair', 'ch@gmail.com', 'Info', 'Cant find my food yet', '2024-07-05 06:51:19', NULL),
(107, 'misbuu', 'misbah123@gmail.com', NULL, 'hloo dear', '2024-08-01 17:18:56', NULL),
(108, 'ayeha', 'ayeshii99@gmail.com', 'good food', 'your food is so delicious', '2024-08-02 06:28:39', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `products_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`products_id`)),
  `name` varchar(250) NOT NULL,
  `email` text DEFAULT NULL,
  `phone` text DEFAULT NULL,
  `address` text DEFAULT NULL,
  `paymentmethod` varchar(250) NOT NULL,
  `subtotal` varchar(250) NOT NULL,
  `status` text NOT NULL DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `user_id`, `products_id`, `name`, `email`, `phone`, `address`, `paymentmethod`, `subtotal`, `status`, `created_at`, `updated_at`) VALUES
(48, 1, '[{\"productid\":33,\"quantity\":2,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":3,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb chakala rawalpindi', 'cash', '14700', 'completed', '2024-07-04 07:52:14', '2024-07-04 07:57:39'),
(49, 1, '[{\"productid\":33,\"quantity\":3,\"price\":3600,\"name\":\"Italian Pizza\"}]', 'Zubair', 'c@gmail.com', '0303166399812', 'ccb chakala', 'ezypaisa', '10800', 'completed', '2024-07-04 08:00:08', '2024-08-02 10:14:17'),
(50, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":1,\"price\":2500,\"name\":\"Chees pizza\"}]', 'ali', 'aki@gmail.com', '0301663981', 'ccb chakala', 'ezypaisa', '6100', 'active', '2024-07-04 08:01:34', NULL),
(51, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"}]', 'Khan', 'khan@gmail.com', '026598566336', 'kohat ccb', 'cash', '3600', 'active', '2024-07-04 08:02:24', NULL),
(52, 1, '[{\"productid\":35,\"quantity\":2,\"price\":790,\"name\":\"Zinger Burger\"}]', 'zubair Hussain', 'ch@gmail.com', '03016639812', 'CCB chakala gujrat', 'cash', '1580', 'active', '2024-07-05 06:57:51', NULL),
(53, 1, '[{\"productid\":33,\"quantity\":2,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":1,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb chakala', 'cash', '9700', 'active', '2024-07-22 07:25:59', NULL),
(54, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":1,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb', 'cash', '6100', 'active', '2024-07-22 07:46:47', NULL),
(55, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":1,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb rawalpindi', 'cash', '6100', 'completed', '2024-07-22 08:01:34', '2024-08-02 10:14:30'),
(56, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":1,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb chakala', 'cash', '6100', 'active', '2024-07-22 08:25:30', NULL),
(57, 1, '[{\"productid\":33,\"quantity\":1,\"price\":3600,\"name\":\"Italian Pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb', 'ezypaisa', '3600', 'active', '2024-07-22 08:31:27', NULL),
(58, 1, '[{\"productid\":33,\"quantity\":2,\"price\":3600,\"name\":\"Italian Pizza\"},{\"productid\":34,\"quantity\":3,\"price\":2500,\"name\":\"Chees pizza\"}]', 'zubair', 'chzubair364@gmail.com', '03016639812', 'ccb', 'cash', '14700', 'active', '2024-07-23 09:11:43', NULL),
(59, 6, '[{\"productid\":\"33\",\"quantity\":\"3\",\"price\":\"3600\",\"name\":\"Italian Pizza\"},{\"productid\":\"34\",\"quantity\":\"1\",\"price\":\"2500\",\"name\":\"Chees pizza\"}]', 'rasheed', 'rasheed@gmail.com', '03445566777', 'H/13 Islamabad', 'cash', '13300', 'active', '2024-08-02 06:44:06', NULL),
(60, 6, '[{\"productid\":\"37\",\"quantity\":\"1\",\"price\":\"1500\",\"name\":\"Cheese Pasta\"}]', 'rasheed', 'rasheed@gmail.com', '01112223333', 'g13 islamaba', 'cash', '1500', 'active', '2024-08-02 07:06:03', NULL),
(61, 9, '[{\"productid\":\"40\",\"quantity\":\"1\",\"price\":\"650\",\"name\":\"Nooles Pasta\"}]', 'Sidra bibi', 'khanisidra.1122@gmail.com', '03495035138', 'H/13 Islamabad', 'cash', '650', 'active', '2024-08-07 15:31:48', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
  `id` int(11) NOT NULL,
  `orderid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `product_name` text DEFAULT NULL,
  `product_price` text DEFAULT NULL,
  `quantity` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `name` text DEFAULT NULL,
  `slug` varchar(250) NOT NULL,
  `categoryid` int(11) NOT NULL,
  `cut_price` float DEFAULT NULL,
  `price` float DEFAULT NULL,
  `image` text DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `stock` varchar(50) NOT NULL DEFAULT 'in stock',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `slug`, `categoryid`, `cut_price`, `price`, `image`, `description`, `stock`, `created_at`, `updated_at`) VALUES
(33, 'Italian Pizza', '', 25, NULL, 3600, '1719663706pizza3.jpg', 'pizza', 'in stock', '2024-06-29 19:21:46', '2024-06-29 19:21:46'),
(34, 'Chees pizza', '', 25, NULL, 2500, '1719987370cheesepozza.jpeg', 'very good taste ready to deliver', 'in stock', '2024-07-03 13:16:10', '2024-07-03 13:16:59'),
(35, 'Zinger Burger', 'zinger-burger', 26, NULL, 790, '1720157862zingerburger.png', 'Hot fried chicken is sandwiched between a sesame bun together with lettuce and a creamy dressing for a classic chicken burger with a hint of spice. A Zinger Burger is KFC\'s original fried chicken recipe with a spicy twist.', 'in stock', '2024-07-05 12:37:42', '2024-07-05 12:37:42'),
(37, 'Cheese Pasta', 'cheese-pasta', 28, NULL, 1500, '1722580031chese pasta.webp', 'Cheese Pasta', 'in stock', '2024-08-02 10:27:11', '2024-08-02 10:27:11'),
(40, 'Nooles Pasta', 'nooles-pasta', 28, NULL, 650, '1722582527pasta.webp', 'Noodles Pasta', 'in stock', '2024-08-02 11:08:47', '2024-08-02 11:08:47'),
(41, 'Karachi Biryani', 'karachi-biryani', 29, NULL, 980, '1722585369hydbiryani.jpeg', 'Karachi Biryani', 'in stock', '2024-08-02 11:56:09', '2024-08-02 11:56:09');

-- --------------------------------------------------------

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `id` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `image` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_images`
--

INSERT INTO `product_images` (`id`, `productid`, `image`, `created_at`, `updated_at`) VALUES
(64, 33, '1719663706pizza3.jpg', '2024-06-29 19:21:46', '2024-06-29 19:21:46'),
(65, 33, '1719663706pizza2.jpg', '2024-06-29 19:21:46', '2024-06-29 19:21:46'),
(66, 33, '1719663706pizza.jpg', '2024-06-29 19:21:46', '2024-06-29 19:21:46'),
(67, 34, '1719987370pizza.jpeg', '2024-07-03 13:16:10', '2024-07-03 13:16:10'),
(68, 35, '1720157862zingerburger.png', '2024-07-05 12:37:42', '2024-07-05 12:37:42');

-- --------------------------------------------------------

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` int(11) NOT NULL,
  `comment` varchar(250) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `rating` int(11) DEFAULT NULL,
  `created_at` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `reviews`
--

INSERT INTO `reviews` (`id`, `comment`, `user_id`, `product_id`, `rating`, `created_at`) VALUES
(14, 'good food', 1, 33, 2, '2024-07-22'),
(15, 'very nyc i like it', 1, 34, 3, '2024-07-22'),
(16, 'yummy taste', 1, 33, 5, '2024-07-22'),
(17, 'great food', 1, 34, 4, '2024-07-22'),
(18, 'i like the tase of food very good enviorment', 1, 33, 5, '2024-07-23'),
(19, 'i like the tase of food very good enviorment', 1, 34, 5, '2024-07-23'),
(20, 'good food', 6, 33, 3, '2024-08-02'),
(21, 'good food', 6, 34, 3, '2024-08-02'),
(22, 'great', 6, 37, 3, '2024-08-02'),
(23, 'great', 9, 40, 2, '2024-08-07');

-- --------------------------------------------------------

--
-- Table structure for table `setting`
--

CREATE TABLE `setting` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `location` varchar(255) NOT NULL,
  `logo` varchar(255) NOT NULL,
  `favicon` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` (`id`, `name`, `phone`, `email`, `location`, `logo`, `favicon`, `created_at`, `updated_at`) VALUES
(1, 'Foodie Food', '+123-4567-890', 'info@exclusive.com', 'UAE - Dubai - United Arab Emirates', '1723043981b9b21bc272a7a34f9f7dece6e53ff08a-removebg-preview.png', '1723044036b9b21bc272a7a34f9f7dece6e53ff08a-removebg-preview.png', '2023-03-20 06:55:50', '2024-08-07 19:20:36');

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `contactus`
--
ALTER TABLE `contactus`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `order_details`
--
ALTER TABLE `order_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `orderid` (`orderid`),
  ADD KEY `productid` (`productid`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `products_ibfk_1` (`categoryid`);

--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `productid` (`productid`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `setting`
--
ALTER TABLE `setting`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `contactus`
--
ALTER TABLE `contactus`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=109;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;

--
-- AUTO_INCREMENT for table `order_details`
--
ALTER TABLE `order_details`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;

--
-- AUTO_INCREMENT for table `product_images`
--
ALTER TABLE `product_images`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=70;

--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `setting`
--
ALTER TABLE `setting`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `order_details`
--
ALTER TABLE `order_details`
  ADD CONSTRAINT `order_details_ibfk_1` FOREIGN KEY (`orderid`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `order_details_ibfk_2` FOREIGN KEY (`productid`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`categoryid`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `product_images`
--
ALTER TABLE `product_images`
  ADD CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`productid`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

