Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielveselinov/laravel-cart-in-session
Create a new order with all the products that the user has in their shopping cart using services and http session in Laravel.
https://github.com/danielveselinov/laravel-cart-in-session
cart eloquent-models facades http-session laravel livewire management php82
Last synced: about 1 month ago
JSON representation
Create a new order with all the products that the user has in their shopping cart using services and http session in Laravel.
- Host: GitHub
- URL: https://github.com/danielveselinov/laravel-cart-in-session
- Owner: danielveselinov
- Created: 2023-03-23T09:23:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T21:17:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T13:01:46.826Z (2 months ago)
- Topics: cart, eloquent-models, facades, http-session, laravel, livewire, management, php82
- Language: PHP
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### The Goal
The end goal will be to create a new order with all the products that the user has in their shopping cart. To enable that, we'll need some Livewire components for updating the values without reloading the page as well as a shopping cart that keeps track of the products of our users (the users's products?). Quick spoiler, we'll use a Service class for that and in there we'll use Laravel's Session facade.
So, we'll be building a very barebones webshop. I'll try to keep it short and simple in two steps: adding products to the cart and using the cart to place an order.
#### Project Setup
To run this project locally you need to clone the repository. Then you will need to run following commands:
```
composer install
cp .env.example .env
artisan key:generate
```Then you need to setup the DB, and after you can run:
```
artisan migrate
artisan db:seed (?optional)
```One last step is to install the npm and compile the assets.
```
npm install
```