A small t-shirt e-shop with Livewire components to pick the t-shirt size/color and add it to Cart, and with Activity Log by Spatie, with Log viewer(s).
This project demonstrates a small t-shirt e-shop with ability to pick the t-shirt size/color (powered by Livewire), add it to Cart, and then Place Order (just in DB, no payments handled in this project).
On the back-end, Activity Log package logs many events and show them on the dashboard powered by Laravel Breeze.
Feel free to pick the parts that you actually need in your projects.
How to install
- Clone the repository with
git clone
- Copy the
.env.example
file to.env
and edit database credentials there - Run
composer install
- Run
php artisan key:generate
- Run
php artisan migrate --seed
(it has some seeded data for your testing) - Run
npm install
andnpm run build
- Launch the main URL
/
. Admin login: [email protected] / password - That's it.
Screenshots
How It Works: Livewire Size/Color Picker
On the Product page, as a part of the detailed information, there's a product-selection
Livewire component:
<div> <h1 class="text-3xl font-bold text-gray-900">{{ $product->name }}</h1> <p class="text-3xl font-bold text-blue-600 mt-4">${{ $product->price }}</p> @if($product->description) <p class="text-gray-600 mt-6">{{ $product->description }}</p> @endif</div> <livewire:product-selection :product="$product" />
Then, in the app/Livewire/ProductSelection.php
there's all the logic to choose colors/sizes.
The main part is...