Загрузка...

Laravel 12 Tutorial #116 | Tax / GST Management | Integrate Product-Level Tax (GST)

🔗Laravel 12 Multi-Vendor E-commerce Series Complete Playlist:
https://www.youtube.com/playlist?list=PLLUtELdNs2ZZ_hI7DvqrrhX-ASGD1U2Dl

Welcome to Part 116 of Laravel 12 Multi-Vendor E-commerce Series, where we’re building a complete, professional Multi-Vendor E-commerce Website from scratch.

In this part, we will implement product-level tax (GST) in the Laravel 12 Multi-Vendor E-commerce series.

We will calculate GST per product, add product_gst and product_gst_amount to order items, save the order taxes total, and display the tax breakdown on the checkout page, admin order details, and my-orders.

✨ Step-by-Step Implementation

1) Migrations — add columns

Create migration for orders and order_items. Two small migrations (or one combined) — paste and run php artisan make:migration then replace file content with below or create two files.

Migration A — add taxes to orders
File: database/migrations/xxxx_xx_xx_add_taxes_to_orders_table.php

Migration B — add product_gst and product_gst_amount to order_items
File: database/migrations/xxxx_xx_xx_add_gst_to_order_items_table.php

Run migrations:
php artisan migrate

2) Model updates — fillables
Add new attributes to Order and OrderItem so they can be mass-assigned.

3) Compute taxes on checkout — expose in cart
We will calculate GST per item and total GST inside CheckoutService::getCartForCheckout() so the view (and PayPal preview) can show them.
File: app/Services/Front/CheckoutService.php

Note: We keep subtotal as product totals pre-tax; taxes_total is shown separately.

4) Save taxes when creating order (createOrderFromCart)
File: app/Services/Front/CheckoutService.php

5) Update checkout view to show tax line
File: resources/views/front/checkout/index.blade.php — find the right column where you show Subtotal / Discount / Wallet / Shipping.

6) Show taxes in Admin Order detail & My Orders
A — Admin order details (resources/views/admin/orders/show.blade.php)
In the Order Items table header, add columns for GST percent and GST amount (or extend each row).
B — My orders / frontend order details
Same idea — wherever you show order items and totals, add those two columns/lines.

📢 Don’t forget to Like, Share & Subscribe for more Laravel tutorials! 🚀

🔗Bookmark & follow this Laravel 12 Multi-Vendor E-commerce Series:
https://www.youtube.com/playlist?list=PLLUtELdNs2ZZ_hI7DvqrrhX-ASGD1U2Dl

►Click here to subscribe for Laravel & other updates - https://www.youtube.com/stackdevelopers

Popular Stack Developers Series that can help you:-

►Laravel 12 Tutorial (with MySQL): https://www.youtube.com/playlist?list=PLLUtELdNs2ZbqkUOd-oXHemay3BrsqZqC

►Laravel 11 Tutorial (with MongoDB): https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTn3ft4BMaAilhZJYLMs9d

►Laravel 11 PostgreSQL Tutorial: https://www.youtube.com/playlist?list=PLLUtELdNs2ZZy4jI-wu4jYUL7rbvC8Mgh

►Laravel API Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P

►jQuery Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbMYoUA46GIonOH29KcjtxA

►Laravel Basic E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZY5drPxIWzpq5crhantlzp7

►Laravel Dating Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZrPUnxjlomErJfNvkyS6Hf

►Join this channel to get the complete source code of all series:
https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join

Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - http://facebook.com/stackdevelopers2/
►Join Facebook Group to resolve your queries - http://facebook.com/groups/stackdevelopers
►Follow on Instagram - https://www.instagram.com/stackdevelopers2/
►Follow on GitHub - https://github.com/stackdevelopers

#Laravel12 #LaravelEcommerce #MultiVendor #EcommerceDevelopment #WebDevelopment #LaravelTutorial

Видео Laravel 12 Tutorial #116 | Tax / GST Management | Integrate Product-Level Tax (GST) канала Stack Developers
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять