TechHaven
A complete electronics store built with Laravel 13: modern storefront, secure checkout with five payment methods, responsive admin panel and a browser installer. Thank you for your purchase!
Features
Server requirements
| Item | Requirement |
|---|---|
| PHP | 8.3 or 8.4 |
| Database | MySQL 5.7+ / 8.x or MariaDB 10.4+ |
| PHP extensions | PDO + pdo_mysql, mbstring, openssl, tokenizer, xml, ctype, json, fileinfo, gd, curl, zip |
| Web server | Apache with mod_rewrite (cPanel, Plesk, DirectAdmin ...) or Nginx |
| Writable folders | storage/, bootstrap/cache/, public/uploads/ and the .env file |
| Optional | Cron job, an SMTP mailbox, Stripe / PayPal / Razorpay accounts, Google / Facebook developer apps |
The vendor/ folder is included, so you do not need Composer, Node.js or SSH.
Package contents
TechHaven-v1.0.0.zip
├── techhaven/ the script (upload this folder's contents)
│ ├── app/ bootstrap/ config/ database/ lang/ resources/ routes/ storage/ vendor/
│ ├── public/ web root (index.php, assets/, uploads/)
│ ├── .htaccess lets you upload everything into public_html
│ └── .env.example
├── documentation/ this guide
└── START-HERE.txt
Installation (cPanel and other shared hosting)
- Create a database. In cPanel open MySQL® Databases, create a database and a user, and add the user to the database with All privileges. Write down the three names and the password.
- Upload the files. Open File Manager, go to
public_html(or a sub-domain folder), upload the contents of thetechhavenfolder and extract them. Make sure the hidden files.htaccessand.env.examplewere extracted too. - Point the domain (recommended). If your host lets you choose the document root, point the domain to the
publicfolder. If not, the included root.htaccesssends every request topublic/and blocks access to private files. - Run the installer. Open
https://your-domain.com/installand follow the four steps: requirements, database, store & administrator, finished. Tick Import demo products if you want to start with the sample catalogue. - Sign in. Your admin panel is at
https://your-domain.com/admin(or the folder name you chose in the installer). - Finish the setup in Admin › Settings: logo and colours, SMTP, payment gateways, shipping and tax.
storage/app/installed.lock). To reinstall, delete that file and empty the database.
Cron job
Add one cron job in cPanel › Cron Jobs, running every minute:
* * * * * /usr/local/bin/php /home/USER/public_html/artisan schedule:run >> /dev/null 2>&1
It cancels card/PayPal/Razorpay orders that stay unpaid for 48 hours (and puts the stock back) and, in demo mode, restores the demo data every three hours. The store works without cron; these clean-ups simply do not run.
Sub-folder, VPS and Nginx
Sub-folder
Upload into e.g. public_html/shop and open https://your-domain.com/shop/install. Use the full address (with /shop) as the store URL.
VPS / Nginx
server {
listen 80;
server_name your-domain.com;
root /var/www/techhaven/public;
index index.php;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ ^/uploads/.*\.php$ { deny all; }
location ~ /\. { deny all; }
}
Give the web server user write access: chown -R www-data:www-data storage bootstrap/cache public/uploads .env.
Admin panel tour
| Menu | What you can do |
|---|---|
| Dashboard | Sales, orders, customers and products with growth, sales chart, recent orders, top products, sales by category, recent activity. |
| Products | Add/edit products with gallery, variants (colours, storage with price difference), highlights, key features, specifications, video banner, deal countdown, SEO fields, stock. |
| Orders | Filter, open, change status, add tracking, approve bank transfers, print invoices, export CSV. |
| Customers | Profiles, orders, addresses, block/unblock, export. |
| Categories / Brands | Icons, images, category banners and extra filter groups. |
| Coupons | Percentage, fixed amount or free shipping; minimum spend, limits, first-order only, dates. |
| Promotions | Hero slides, promo banners, offer strips and sidebar promos. |
| Reviews | Approve or reject customer reviews. |
| Reports | Revenue by day, orders by status, top products, sales by category and payment method. |
| Marketing | Newsletter subscribers and sending a newsletter. |
| Settings | General, colours, store, shipping, payments, mail, social login, SEO, AdSense, security. |
Logo, colours and texts
Settings › General: store name, tagline, logo (dark and light version), favicon, footer text, top-bar texts, social links and app links. Settings › Theme: pick one of the colour presets or set your own primary, accent, navy, sale and success colours. The storefront, admin panel and e-mails use them immediately.
Products and categories
- Categories can have a parent. Top categories appear in the All Categories menu; the icon is a Bootstrap Icons name such as
phoneorlaptop(see icons.getbootstrap.com). - Category banner: kicker, title (second line is coloured), text, image and the handwritten note shown on the category page.
- Extra filters: one group per line in the form
key|Label|Option 1,Option 2, e.g.display|Display Size|11" - 13",14" - 15". On the product form, tick the options that apply to that product. - Variants: colours (name + colour code) and storage options with a price difference (e.g. 512GB = +200).
- Badges: Best Seller, New or Hot; otherwise the discount percentage is shown automatically when a compare-at price is set.
- Hot deals: tick Show in Hot Deals; set a deal end date to show the countdown on the product page.
Banners and promotions
Promotions controls every marketing block: home_hero (slider), home_promo (two banners), listing_offer (offer strip on category pages), search_hero, search_side, search_offer and checkout_offer. In hero titles, wrap words in *stars* to colour them.
Orders and customers
Order statuses: Pending → Processing → Shipped → Delivered (or Cancelled / Refunded). Customers receive an e-mail when an order is placed, paid, shipped, delivered or cancelled. Cancelling an order puts the stock back. Cash-on-delivery orders are marked paid when you set them to Delivered.
Shipping, tax and currencies
Settings › Shipping: free-shipping threshold, standard and express fees and delivery times. Settings › Store: tax percentage and label. Currencies: add currencies with an exchange rate against your store currency; visitors pick one in the top bar and are charged in that currency.
Coupons
Types: percentage, fixed amount and free shipping. Options: minimum spend, maximum discount, total and per-customer limits, first order only, start and end dates. A coupon is counted once the order is paid (cash on delivery: when placed).
Payment gateways
Open Settings › Payments, switch a gateway on and paste its keys. A gateway without keys is never shown at checkout.
Stripe (cards, saved cards)
- In the Stripe dashboard › Developers › API keys copy the Publishable key and Secret key.
- Developers › Webhooks › Add endpoint: URL
https://your-domain.com/webhooks/stripe, eventpayment_intent.succeeded. Copy the Signing secret (whsec_...) into the admin. - Test with card
4242 4242 4242 4242, any future date and any CVC while using test keys.
PayPal
- developer.paypal.com › Apps & Credentials › create an app; copy the Client ID and Secret.
- Choose Sandbox for testing and Live for real payments. Payments are captured on the server when the customer returns; no webhook is needed.
Razorpay (UPI, cards, net banking, wallets)
- Razorpay dashboard › Settings › API Keys: copy the Key ID and Key Secret.
- Settings › Webhooks: URL
https://your-domain.com/webhooks/razorpay, eventspayment.capturedandorder.paid, choose a secret and paste the same secret in the admin.
Bank transfer
Enter your bank details. After placing the order the customer sees them, transfers the money and submits the transfer reference (and optionally a receipt). You approve the payment in Orders.
Cash on delivery
Switch it on and optionally set a maximum order amount.
How payments are protected
- An order is only marked paid after the payment was confirmed with the provider on the server: the Stripe PaymentIntent is retrieved with the secret key, the PayPal order is captured by the server, the Razorpay signature is checked and the payment is fetched from the Razorpay API.
- Every webhook checks the provider signature on the raw request body and fails closed: without a configured secret it answers
400and changes nothing. - Amount (in minor units), currency, provider order id and our order code must all match the stored order.
- A provider payment id is stored in a unique column, so one payment can never pay two orders. Bank references are normalised and accepted once.
- Return pages look the order up by its code and the signed-in owner and only use the provider id stored with the order.
- Completion is idempotent: e-mails, coupon usage and sales counters run once.
- The rules are covered by automated tests in
tests/Feature/PaymentSecurityTest.php.
E-mail (SMTP)
Settings › Mail: choose SMTP, enter host, port, user name, password and encryption, then press Send test e-mail.
| Provider | Host | Port / encryption |
|---|---|---|
| cPanel mailbox | mail.your-domain.com | 465 / SSL or 587 / TLS |
| Gmail / Google Workspace | smtp.gmail.com | 587 / TLS (use an App Password) |
| Microsoft 365 | smtp.office365.com | 587 / TLS |
| Brevo | smtp-relay.brevo.com | 587 / TLS |
| Mailgun | smtp.mailgun.org | 587 / TLS |
| Amazon SES | email-smtp.REGION.amazonaws.com | 587 / TLS |
With Log selected, e-mails are written to storage/logs/laravel.log instead of being sent (useful for testing).
E-mail templates
Settings › E-mail templates lists every automatic e-mail. Edit the subject, heading, body and button text; words in curly braces such as {name} or {order_code} are replaced automatically. Use Preview to see the branded layout.
Google and Facebook login
- console.cloud.google.com › APIs & Services › Credentials › Create OAuth client ID (Web application).
- Authorised redirect URI:
https://your-domain.com/auth/google/callback. - Paste the Client ID and Client secret in Settings › Social Login and switch it on.
- developers.facebook.com › Create app › add Facebook Login.
- Valid OAuth redirect URI:
https://your-domain.com/auth/facebook/callback. - Paste the App ID and App secret in the admin and switch it on. Put the app in Live mode.
SEO and sitemap
Every page has a title, description, canonical URL, Open Graph and Twitter tags. Products, categories, blog posts and pages have their own SEO fields. Structured data: Organization (all pages), Product with price, availability and rating, BlogPosting. The sitemap is generated live at /sitemap.xml and listed in /robots.txt; submit it in Google Search Console. Add your Google Analytics 4 ID and site verification code in Settings › SEO.
Google AdSense
Settings › AdSense: switch it on, enter your publisher id (ca-pub-...) and the ad-slot ids for the home, listing, product and blog positions. /ads.txt is created automatically from your publisher id.
Security
- CSRF protection on every form, signed webhooks, rate limiting on sign-in, registration, contact and checkout.
- Uploaded images are re-encoded (EXIF and hidden content removed) and PHP never runs inside
public/uploads. - HTML written in the admin is cleaned with an allow-list.
- Security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, HSTS on HTTPS).
- Optional two-step admin login with a code sent by e-mail, Google reCAPTCHA v2 on public forms, maintenance mode.
- API keys and the SMTP password are stored encrypted.
APP_DEBUG=falseafter installation. Keep it that way on a live site.
Admin folder name
Settings › Security › Admin folder: change admin to something only you know, e.g. store-office-24. You are redirected to the new address; bookmark it. If you ever forget it, open .env and look at ADMIN_PATH.
Public demo mode
- Install on a sub-domain with demo data.
- Set
DEMO_MODE=truein.env. - Run
php artisan techhaven:demo-adminto create a read-only admin (demo@demo.com / demo1234by default; change withDEMO_ADMIN_EMAILandDEMO_ADMIN_PASSWORD). - The login pages show the demo logins with a Fill button, admin changes are blocked, and the demo customer's e-mail and password cannot be changed.
- With the cron job, the demo data resets every three hours (
php artisan techhaven:demo-reset); admins and settings are kept. - Use gateway test keys on a demo; payments are never simulated.
Translation
All texts use Laravel's translation helper. A complete Spanish example is included in lang/es.json. To add a language:
- Copy
lang/es.jsonto e.g.lang/fr.jsonand translate the values (keep the keys and the:placeholders). - Add the language to
config/techhaven.php›languages(code, name, flag).
Product names, categories, pages and e-mail templates are content you edit in the admin.
Customising the design
- Views:
resources/views/front(pages),partials(header, footer, product card),admin. - Styles:
public/assets/css/app.css(base and components),pages.css,responsive.css,admin.css. No build step: edit and refresh. - Colours come from Settings › Theme as CSS variables (
--primary,--navy...). - Fonts: Plus Jakarta Sans and Caveat are self-hosted in
public/assets/fonts.
Updating
- Back up your files and database.
- Upload the new version over the old one, but keep your
.env,public/uploads/andstorage/. - Open
https://your-domain.com/admin; if the version notes mention database changes, runphp artisan migrate --force(or ask your host).
Troubleshooting
| Problem | Solution |
|---|---|
| 500 error right after upload | Check the PHP version (8.3+) and that storage and bootstrap/cache are writable (755 or 775). |
| Only the home page works | mod_rewrite is off or the .htaccess files were not uploaded (they are hidden files). |
| Images or CSS missing | The store URL in .env (APP_URL) must match the address you open, including https. |
| E-mails are not sent | Use Send test e-mail; the error is written to storage/logs/laravel.log. |
| Card field does not appear | Check the Stripe publishable key and that the site runs on HTTPS. |
| Payment received but order still unpaid | Check the webhook URL and signing secret; the gateway dashboard shows the webhook response. |
| "Page expired" (419) | The session expired; reload the page. Make sure the domain does not switch between www and non-www. |
| Forgot the admin folder | See ADMIN_PATH in .env. |
Credits and licences
- Laravel framework and PHP libraries (Socialite, stripe-php, razorpay-php, Symfony components) - MIT.
- Bootstrap Icons - MIT.
- Plus Jakarta Sans and Caveat fonts - SIL Open Font License.
- Chart.js - MIT.
- Demo photos of people from Pexels (Pexels licence), listed in
public/uploads/demo/CREDITS.txt. Product names and brand logos in the demo data belong to their owners and are used for demonstration only; replace them with your own products.
Changelog
1.0.0
- First release.