Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

FrankClark's avatar

Laravel Eloquent Conditional BelongsTo relationship

Hello There, I'm having to shoe-horn in an extra layer into my laravel project and trying to find an elegant solution to an issue. I have organisations, customers, and users. An organisation has many customers, a customer has many users. I have a middleware that redirects a user to select which customer they want to proceed with. This is then set as a cookie so that any subseq

FrankClark's avatar
FrankClark's avatar ahmeddabak6yrs agoEloquent
5
1
Last reply by ahmeddabak 6yrs ago
Aunik's avatar

Nuxt js

Please make series on full eCommerce with nuxt.js (SSR) and laravel api.

Aunik's avatar
Aunik's avatar Aunik6yrs agoJavaScript
0
1
kankai's avatar

How to sort items after search items

Hi all, I'm doing a ecommerce website that can search item, and after that i need to add in sort option in it. But i dun know how to add in previous request input to sort function. In my view i have two form <form action="{{ url('shop/'.$cat.'/search') }}" method="GET"> <div id="price_range" class="noUi-target noUi-ltr noUi-horizo

kankai's avatar
kankai's avatar Snapey6yrs agoLaravel
2
1
Last reply by Snapey 6yrs ago
mspace's avatar

location api in Laravel project

I am working on an e-commerce store that is restricted to only a certain region. When customers want to fill in the address, I will like to have a dropdown that shows only cities within the region the store will be operating. I have heard about google maps api but it is quite expensive. Please how can I achieve this?

mspace's avatar
mspace's avatar mehmetanba...6yrs agoLaravel
1
1
Last reply by mehmetanbaki 6yrs ago
weblearner's avatar

Stack on query string with vuejs using AJAX

Hi, I am building an e-commerce site for my college graduation and facing an issue with vuejs to send the ajax call. URL like this is giving me result easly no what so ever issue here => https://ecommerce.test/api/categoryproducts?brand=apple but now I want to send the request like this => https://ecommerce.test/api/categoryproducts?brand=apple&minPrice=0&maxPric

weblearner's avatar
weblearner's avatar jeffreyvan...6yrs agoVue
4
1
Last reply by jeffreyvanrossum 6yrs ago
Bacchus's avatar

Laravel Automagic for Beginners?

Hello, I'm pretty novice and have built some makeshift frameworks before for e-commerce projects, but have never used a mature framework like Laravel outside of exploration. I just finished Laravel 5.7 from Scratch, and I still have a lot of questions about how to wrap my head around all the things Laravel offers me. For example, when I create a model, I still don't understand

Bacchus's avatar
Bacchus's avatar bugsysha6yrs agoCode Review
3
1
Last reply by bugsysha 6yrs ago
Alewa's avatar

Laravel 6 JQuery Error

Hello, i am working on a ecommerce application with laravel 6 and when i want to update my product quantity with axios this is the error i am getting app.js:10232 jQuery.Deferred exception: $(...).lightBox is not a function TypeError: $(...).lightBox is not a function at HTMLDocument.<anonymous> (http://localhost/commerce/public/assets/frontend/themes/js/bootshop.js:1

Alewa's avatar
Alewa's avatar ahmeddabak6yrs agoLaravel
1
1
Last reply by ahmeddabak 6yrs ago
bmpf's avatar

Execution time issues on server. ( 150 ms average localhost vs 300 ms average on live server )

Hello, Recently I made a eCommerce website using laravel as api. Everything is working fine but there is one thing bothering me. In my live server the average request is 300 ms , and in localhost is 150 ms [average] - Takes twice the time. I can't understand why that happens. I downloaded the exact same project to my localhost , Set up the database to be connected to the live

bmpf's avatar
bmpf's avatar bmpf6yrs agoCode Review
13
1
Last reply by bmpf 6yrs ago
davy_yg's avatar

Purchasing Item

Hello, I would like to ask for input about creating something like this: When customer seeing item they want to purchase they can use their handphone to scan the sample item. And they item is suddenly being placed in the shopping cart. After scanning all the sample items they would like to purchase they can go to the cashier to pay for items while the real items that they purc

davy_yg's avatar
davy_yg's avatar davy_yg6yrs agoGeneral
9
1
Last reply by davy_yg 6yrs ago
TheOnlineThomas's avatar

Laravel theme development option by 3rd party

Hi, Imagine I want to create a webstie for e-commerce where users can develop theme for their own store. Now I have few concerns. How to prevent execute php commands through the theme? How to allow theme developers to use only variables provided to them? I am blur with this concept. Any kinds of support will be highly appreciated. Thanks is advance.

TheOnlineThomas's avatar
TheOnlineThomas's avatar tisuchi6yrs agoLaravel
8
1
Last reply by tisuchi 6yrs ago
Gabotronix's avatar

Use StripeController action in ProductController?

Hi everybody, I created my own laravel-vue e-commerce app, people buy Product Model with Stripe PHP sdk, what I was doing till now is I created a StripeController for handling stripe operations like charge, start subscriptions, refunds (for me this made sense), but I noticed my StripeController is not the best way to do this, before finsihing a charge I performed some actions l

Gabotronix's avatar
Gabotronix's avatar Gabotronix6yrs agoGeneral
1
1
Last reply by Gabotronix 6yrs ago
WebbieWorks's avatar

Which Route is better?

Hey all, I am learning Laravel and I have seen the routes coded in 2 different ways and was wondering which one is better (easier) for an ecommerce site? Route::get('/used-equipment.php', 'UsedController@index')->name('usedequipment.index'); or Route::get('/used-equipment.php', [ 'uses' => 'ProductController@usedCategoryList', 'as' => 'categories.usedequipment

WebbieWorks's avatar
WebbieWorks's avatar goldtaste6yrs agoLaravel
3
1
Last reply by goldtaste 6yrs ago
Hamid9's avatar

Product price Ascending or Descending order

Hello, i am new to laravel, i am building an eCommerce web_site. i wont to sort my products in ascending,descending price. when customer click "Lower To Higher" or "Higher to Lower". if some one knows the solution please answer?

Hamid9's avatar
Hamid9's avatar Maracaibo6yrs agoLaravel
2
1
Last reply by Maracaibo 6yrs ago
davy_yg's avatar

SEO

Hello, I am buiding a blog for my ecommerce website. The blog is using a different domain name - and using wordpress. Using a different domain is it beneficial for seo the websites? Any ideas?

davy_yg's avatar
davy_yg's avatar promodomec...6yrs agoGeneral
23
1
Last reply by promodomecommunications 6yrs ago
dazeh's avatar

gloudemans/shoppingcart - Removing Cart from global

Hi all, I'm building an e-commerce site with gloudemans/shoppingcart (https://packagist.org/packages/gloudemans/shoppingcart) When I install it, it automatically allows use of the class "Cart" I want to extend this class but still use the class name; cart. I cant seem to find reference anywhere that may relate to this being called automatically. Any assistance would b

dazeh's avatar
dazeh's avatar Sinnbeck6yrs agoCode Review
1
1
Last reply by Sinnbeck 6yrs ago
solaceng's avatar

Restructuring url to search engine friendly url

My website has its url like this https://example.com/search?subsubcategory=smart-watches But I want something like this https://example.com/smart-watches Please can someone help me on how to create view and route that will display my categories, sub categories and subsubcategories products like this. It is an ecommerce website

solaceng's avatar
solaceng's avatar solaceng6yrs agoLaravel
21
1
Last reply by solaceng 6yrs ago
morganchorlton3's avatar

Appending a collection

Hi all i have been creating an eCommerce platform and I want to add colors to products, to do this I have a section with a selector which then creates a collection and added that colour (so I can display this to the user), I now want to update this collection and add another colour to the collection, is there a way to pass the collection back to the controller so i can do some

morganchorlton3's avatar
morganchorlton3's avatar morganchor...6yrs agoLaravel
4
1
Last reply by morganchorlton3 6yrs ago
calin.ionut's avatar

load laravel.log in a web interface

Hi! I am creating a new admin for my ecommerce (laravel 6) I want to display the log (laravel.log) file in the admin - every time I have to SSH and see if there are any errors in the log. I found 2 third party packages: https://github.com/rap2hpoutre/laravel-log-viewer and https://github.com/danielme85/laravel-log-to-db Is anyone done this ? View log errors in admin or in a web

calin.ionut's avatar
calin.ionut's avatar jove6yrs agoGeneral
1
1
Last reply by jove 6yrs ago
davy_yg's avatar

Saving voucher

When saving voucher information for ecommerce I get this message: 500 Server Error I only modifying what previous dev did. Now, I wonder if this error is customize? Next, why the error appears? The information is saved in the database but the error still appears.

davy_yg's avatar
davy_yg's avatar jove6yrs agoLaravel
5
1
Last reply by jove 6yrs ago
Ranx99's avatar

Vapor vs Forge ?

I building an e-commerce app and I was wondering if I should use Vapor or Forge.. so I have these questions: Is there a big difference in costs between them? Will I face problems when I go with Vapor? since Its server-less? Is Vapor suitable for every-kind of application? Is Vapor taking Forge place from now on? Which one would you use and why? Thanks,

Ranx99's avatar
Ranx99's avatar kurucu2yrs agoVapor
5
4
Last reply by kurucu 2yrs ago
bigweld86's avatar

Use a separate project only for migrations and reference it from other projects

Hello. I've got an e-commerce app which will be basically divided in 2 sections/projects: One section will be in charge of frontend/backend transactions. Frontend pages will be in Vue, backend in Laravel The other section will be basically an admin section, to manage (add/edit/delete) products, orders etc and will be completely build in laravel Both projects will obviously qu

bigweld86's avatar
bigweld86's avatar Sinnbeck6yrs agoGeneral
3
1
Last reply by Sinnbeck 6yrs ago
nolros's avatar

Cache Eloquent Queries - Boot OR Service Provider OR ...

There must be a better way of caching teh model. Let’s assume 5 product families with 5 products in each product family with approx 20 product features for each product i.e. a family will have 5 products and each will have 20 features so a total of 100 features for each family. So the relation will be product_family -> hasMany products -> hasMany features. Example, famil

nolros's avatar
nolros's avatar bobbybouwm...6yrs agoEloquent
4
1
Last reply by bobbybouwmann 6yrs ago
danimohamadnejad's avatar

best way to add messages to a request?

hello. In my ecommerce application I want the users to be able to add coupon codes and get some discount. I am using a form for recieving coupon code from user in form of a POST request. if every thing is okay and coupon code exists user may get discount but there are situations in which coupon code may not exist or use has already used it or it has reache maximum usage count

danimohamadnejad's avatar
danimohamadnejad's avatar Snapey6yrs agoLaravel
3
1
Last reply by Snapey 6yrs ago
AbehoM's avatar

Advanced search with filters (Laravel + Vue)

I'm creating a search with filters, I managed to create the filters using a library called (https://github.com/Tucker-Eric/EloquentFilter) this way I can accept filters by the url query such as /users?name=er&last_name=&company_id=2&roles[]=1&roles[]=4&roles[]=7&industry=5 now I need to create the front end portion using Vue. I found a project called bag

AbehoM's avatar
AbehoM's avatar devansh020...5yrs agoGeneral
1
1
Last reply by devansh0207 5yrs ago
danimohamadnejad's avatar

how to update many rows using IDs?

hello. In ecommerce application I want to reduce stock column of products in the cart after order is set. I have a list of product IDs and also qunatity of each one in the cart. so I have an array of Id-quantity pairs: [ ['1','20'], ['2','15'], ... ] how should I update all products using one query?

danimohamadnejad's avatar
danimohamadnejad's avatar douglasaku...6yrs agoEloquent
3
1
Last reply by douglasakula 6yrs ago
danimohamadnejad's avatar

how to forbid user from model specific property?

hello. in my ecommerce application I want both user and admin to be able to update an Order model. user should update its order model all properties except to "stateId" and admin should only be able to update "stateId" of every order model. now I want both roles use the same PUT route for updating. what is best practice? thank you in advance

danimohamadnejad's avatar
danimohamadnejad's avatar Sti3bas6yrs agoLaravel
5
1
Last reply by Sti3bas 6yrs ago
FutureWeb's avatar

Single, variable and bundled products Database relations

Hi Lara Folks, I've been tasked with porting a legacy ecommerce project to laravel it has some interesting product / size, colour, style relations. And so wanted to know everyones thoughts on how to best tackle the following scenarios: A product can be just that a single product with no size colour or style variations. A product can also have variations or options some of which

FutureWeb's avatar
FutureWeb's avatar FutureWeb6yrs agoLaravel
1
1
Last reply by FutureWeb 6yrs ago
morganchorlton3's avatar

Email Within Laravel

Hi, all I'm setting up and E-commerce website within laravel and I'm looking to add email to the site. I need to send emails with the orders (this is already done) and i want to set up an email account for the client to send and receive emails id like to do this within the app if possible does anyone know of a way to do this or if it is possible (either using a api (mailguin)

morganchorlton3's avatar
morganchorlton3's avatar Snapey6yrs agoLaravel
1
1
Last reply by Snapey 6yrs ago
raviSoni's avatar

A user can access home page without authentication

Basically what i want to do , I am creating a Ecommerce website but when i run a command php artisan ui:auth it creates all neccessary files but main problem is it can't allow a user to access homepage without login or registration what to do ???

raviSoni's avatar
raviSoni's avatar raviSoni6yrs agoLaravel
4
1
Last reply by raviSoni 6yrs ago
danimohamadnejad's avatar

how to round a float to nearest half or whole?

Hello in my ecommerce application I need to display stars based on average rating so average rating may be 0, 0.5, 1,1.5.....5 I want to round float rating averages to the nearest half or whole number: 0.32 ---->> 0 0.45 ---->>0.5 1.92 ----->2 1.65------>1.5 any offer? please help thank you

danimohamadnejad's avatar
danimohamadnejad's avatar Snapey6yrs agoGeneral
2
1
Last reply by Snapey 6yrs ago
danimohamadnejad's avatar

how to get all ratings for specific category?

Hello I want to be able to access all the ratings of a category in ecommerce application. here are tables and models: Category categories -->>id name Product products -->>id name ProductCategory product_categories-->> id product_id category_id Rating ratings-->>id product_id user_id score I am using following method in Category model: public function

danimohamadnejad's avatar
danimohamadnejad's avatar mabdullahs...6yrs agoEloquent
1
1
Last reply by mabdullahsari 6yrs ago
danimohamadnejad's avatar

how to get multi lists together using one query?

hello I am working on ecommerce website with laravel. I want to display most wished for, top rated and best seller products in category page. is it possible to grab them all using one query or should I use three different queries what is best practice? please explain thank you

danimohamadnejad's avatar
danimohamadnejad's avatar Snapey6yrs agoEloquent
3
1
Last reply by Snapey 6yrs ago
danimohamadnejad's avatar

has one through relation in pivot table to another pivot table

Hello I am working on ecommerce applicatio. I want to display product variations in product details page based on a filter option. for instance I have a laptop with color red and I want to be able to display laptops with same information but blue and green color. I need some help in eloquent please consider following tables and models: products Product filters Filter filter_

danimohamadnejad's avatar
danimohamadnejad's avatar danimohama...6yrs agoEloquent
0
1
rushh's avatar

API integration

i have to integrate , https://apidocs.shiprocket.in/?version=latest#fcf028f6-9d53-4eb3-adf1-91f395e0dbd6 this api in my eCommerce site which is in laravel in this api , code is in PHP (cURL) package is needed to install or not ? for cURL , and where i place this code in laravel in resource or controller ?

rushh's avatar
rushh's avatar franciscoc...2yrs agoLaravel
3
1
Last reply by franciscocaldeira 2yrs ago
pn523's avatar

Duplicate key in table

In my Ecommerce database design, in Orders table I have customreId and ShipperId , both of them are stored in users table. Problem is when I reference foreign keys of both of them in orders table I get following error in migration : Illuminate\Database\QueryException : SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table '#sql-555_19' (SQ

pn523's avatar
pn523's avatar Punksolid6yrs agoGeneral
5
1
Last reply by Punksolid 6yrs ago
MattB's avatar

Sending custom emails

How would one go about sending a custom email? I have an ecommerce shop but would like to know how to customise the email sent to customers showing all they have bought. The below email works but I was wondering if there was a better way, as when it's sent the bootstrap link won't work until the customer allows it when they open the mail, and I can appreciate not all people are

MattB's avatar
MattB's avatar Resin6yrs agoLaravel
3
1
Last reply by Resin 6yrs ago
davy_yg's avatar

Checking laravel version

Hello, I have a working ecommerce file created with laravel but I cannot check the laravel version of it. D:\xampp72\htdocs\lekaeshop>laravel --version Laravel Installer 2.1.0 D:\xampp72\htdocs\lekaeshop>php artisan --version Could not open input file: artisan Any clue why?

davy_yg's avatar
davy_yg's avatar Snapey6yrs agoLaravel
4
1
Last reply by Snapey 6yrs ago
rizwan157's avatar

How to track affiliate sales made on third party websites through our affiliate link?

There are two types of users 1- Brand 2- Influencer Brand adds a campaign that influencers will promote with their social network. Brands also provides a coupon code that influencers use in their post that leads to the selling page of the product. (eCommerce platform can be any) Now my main concern is, how can I track either sale is made using that coupon code or not. Need to s

rizwan157's avatar
rizwan157's avatar rizwan1576yrs agoGeneral
0
1
danimohamadnejad's avatar

best way to supply views and rendrable portions with data

Helllo I am creating an ecommerce application using laravel and I want to be able to add filter options to my products. please consider following url: locahost/filter-options?v=fo&with_search=1&with_insert=1 navigating browser to above url may display different views depending upon value of "v" in query string. but I also can specify which optional rendrable

danimohamadnejad's avatar
danimohamadnejad's avatar danimohama...6yrs agoLaravel
9
1
Last reply by danimohamadnejad 6yrs ago
faridsilva's avatar

Refactoring an sql sentence to eloquent style

Hello, I'm refactoring an old e-commerce site from plain PHP to Laravel 5.5. I have a list of products by categories and subcategories, which need to be filtered by brands. I have an opportunities table which depends on products table which is related to a brands table, too. Tables have foreign keys and relations are working fine when lazy loading queries. So, If I call somethi

faridsilva's avatar
faridsilva's avatar kevinbui6yrs agoEloquent
7
1
Last reply by kevinbui 6yrs ago
Randy_Johnson's avatar

Doctrine\DBAL\Driver\PDOException

I keep running into this problem and I have followed all instructions to fix it but it doesn't seem to be working. I am running Linux Mint and I have run composer update etc with the message of that everything is up to date. My composer.json also represents that it is there. "require": { "php": "^7.1.3", "doctrine/dbal": "^2.9",

Randy_Johnson's avatar
Randy_Johnson's avatar Randy_John...6yrs agoGeneral
3
1
Last reply by Randy_Johnson 6yrs ago
hackroot's avatar

Integrating extensions/packages into laravel voyager, is it possible? How do i proceed?

Hi I am working on a eCommerce front-end and POS with inventory system using laravel voyager as back-end, i would really love to implement a forked and updated version of Steve Bauman's inventory system package or extension in to laravel, I would like to know if it's possible. if yes how do i get started? my thought: I was thinking maybe i will manually create models and contro

hackroot's avatar
hackroot's avatar hackroot6yrs agoLaravel
0
1
alishahUK's avatar

Liskov Substitution Principle

Hey guys, I am trying to come up with a real world example for Liskov substitution principle in an ecommerce application context. Now I understand the principle, however, I am struggling to come up with a really good use case. Can any body help out, please?

alishahUK's avatar
alishahUK's avatar bobbybouwm...6yrs agoGeneral
6
1
Last reply by bobbybouwmann 6yrs ago
Lunah's avatar

An approach to 'guest checkout' ?

Hey, I'm due to launch a tiny e-commerce store for a client, it is a very simple Laravel app using the shipped auth, single product purchase, redirecting to Stripe Checkout.js for transactions... typically after picking a product, a user will be asked to log in if they're not already authenticated... if they aren't a member they'll obviously need to register... all purchasing r

Lunah's avatar
Lunah's avatar D97059966yrs agoGeneral
5
1
Last reply by D9705996 6yrs ago
nabilunfarhanun's avatar

Law of demeter.

I am new to programming and got introduced to the law of demeter. I am having trouble understanding it. For example, I have developed a ecommerce related page. In that page, a list of product will be showed with its supplier address. Naturally only supplier's id is in the product page. So, my solution was to show it like this, {{$product->supplier->address()}} The product

nabilunfarhanun's avatar
nabilunfarhanun's avatar JohnBraun6yrs agoGeneral
1
1
Last reply by JohnBraun 6yrs ago
morganchorlton3's avatar

Hermes Parcel Tracking

Hi all im creating a new e-commerce site with laravel 5.8 and was wondering if anyone has intergrated parcel tracking of any kind (i will be using hermes) and how easy or hard it is?

morganchorlton3's avatar
morganchorlton3's avatar poxodab323yrs agoLaravel
1
1
Last reply by poxodab32 3yrs ago
FallOutBoi's avatar

Any global payment systems out there?

Hi, i am trying to build my own personal e-commerce website and i just want people from europe and asian territories to pay with their credit cards, but i can't find anything. I also want to receive the money on my own card account i am from Armenia. Is there a system that allows that?

FallOutBoi's avatar
FallOutBoi's avatar FallOutBoi6yrs agoCode Review
2
1
Last reply by FallOutBoi 6yrs ago
FallOutBoi's avatar

Is this unpractical?

Hello, i am building a simple e-commerce application with laravel and i have like 3 columns for each image location for products table. Is it unpractical to have seperate columns for image or is it best to have one column and fill it with information?

FallOutBoi's avatar
FallOutBoi's avatar Snapey6yrs agoTips
2
1
Last reply by Snapey 6yrs ago
nairobiwebexperts's avatar

Showing catories inventory on homepage

I'm using zcart ecommerce multivendor. I need to change the homepage and display inventories as categories that updates automatically. An example of a site is jumia.co.ke. Kindly help.

nairobiwebexperts's avatar
nairobiwebexperts's avatar nairobiweb...6yrs agoGeneral
0
1
ImtiazEpu's avatar

Laravel redirect()->intended() is not working in custom login method

I am currently developing Cart page of my e-commerce application, If I click on checkout button it will redirect Login page, After login, I need to go to the Checkout page or cart page, But Any time I logged in It will redirect me to Home page. Is there Any easy way to do that in Laravel? public function processLogin() { $validator = Validator::make(request()->al

ImtiazEpu's avatar
ImtiazEpu's avatar ImtiazEpu6yrs agoLaravel
7
1
Last reply by ImtiazEpu 6yrs ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.