Comments (7)
因为此购物车是基于 session 的,所以在存储完成后你不能在后面中断进程,比如 dd() 这样,这样 session 不会正确写入,所以你到其它 controller 中就拿不到了。因为 laravel 的 session 是后续写入的。
from laravel-shopping-cart.
我原本在商品頁裡加入購物車 然後到購物車頁卻沒有看到商品
所以才用dd() 去看session裡有沒有東西
from laravel-shopping-cart.
@sheng0208 嗯,laravel 的 session 是在 response 发送后才写入真正的 session 中,所以你在 dd 的时候看到的只是 class instance 中 property 存储的内容,并不是真正写到 session 后的内容。
from laravel-shopping-cart.
但我剛剛dd註解後 在商品頁面加入購物車後
到購物車畫面 依然沒有看到加入的商品
from laravel-shopping-cart.
@sheng0208 这可能是其它原因,你可以跟一下代码具体在哪一步丢失了,你使用什么来存储 session?
from laravel-shopping-cart.
我大概知道問題了 謝謝你
from laravel-shopping-cart.
@sheng0208 不客气。
from laravel-shopping-cart.
Related Issues (14)
- composer 组件开发 HOT 1
- support 5.7? HOT 6
- About Specifies the associated model HOT 4
- 类中的fire方法替换dispatch方法
- Update does not work during adding of the same item if quantity is different HOT 2
- composer install error HOT 2
- 文档中使用静态方法调用有误吧 HOT 4
- Eager loading associate model
- How to set cart name dynamically? HOT 1
- Creates duplicate item in the cart list
- Undefined type HOT 1
- 关于监听事件传入参数为空的BUG探讨 HOT 1
- Store in database and edit the order
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-shopping-cart.