laravel-from-zero-to-production

πŸš€ Quick Start Guide - Laravel Projects

This guide allows you to quickly test all 5 Laravel projects created in this book.

πŸ“‹ Project Overview

βœ… 1. Todo Application

βœ… 2. Blog Platform

βœ… 3. REST API

βœ… 4. E-commerce Shop

βœ… 5. Wizard Form

πŸ› οΈ Global Prerequisites

Before starting, make sure you have:

System

Software

External accounts (optional)

πŸš€ Quick Installation

Step 1: Verify environment

# Check PHP
php --version

# Check Composer
composer --version

# Check Node.js
node --version

# Check Git
git --version

Step 2: Clone the project

# If you don't have the project yet
git clone <repository-url>
cd "Laravel From Zero to Production"

Step 3: Basic configuration

# Create Python virtual environment (optional)
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# or
.venv\Scripts\Activate.ps1  # Windows

# Install Python dependencies for the website
pip install -r requirements.txt

πŸ“± Testing Projects

# Navigate to the project
cd projects/todo-app

# Install dependencies
composer install

# Configure environment
cp .env.example .env
php artisan key:generate

# Configure database (SQLite for quick testing)
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

# Create database file
touch database/database.sqlite

# Run migrations
php artisan migrate

# Start server
php artisan serve

Quick test:

  1. Open http://localhost:8000
  2. Create a few todos
  3. Test filters (All, Pending, Completed)
  4. Edit and delete todos

Estimated time: 5-10 minutes


2. Blog Platform ⭐⭐

# Navigate to the project
cd projects/blog-platform

# Install dependencies
composer install

# Configure environment
cp .env.example .env
php artisan key:generate

# Configure database
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

# Create database file
touch database/database.sqlite

# Run migrations
php artisan migrate

# Install Breeze (authentication)
composer require laravel/breeze --dev
php artisan breeze:install blade

# Install frontend assets
npm install
npm run build

# Create symbolic link
php artisan storage:link

# Start server
php artisan serve

Quick test:

  1. Open http://localhost:8000
  2. Create a user account
  3. Create an article with image
  4. Test comments
  5. Moderate content

Estimated time: 10-15 minutes


3. REST API ⭐⭐

# Navigate to the project
cd projects/rest-api

# Install dependencies
composer install

# Configure environment
cp .env.example .env
php artisan key:generate

# Configure database
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

# Create database file
touch database/database.sqlite

# Run migrations
php artisan migrate

# Install Sanctum
composer require laravel/sanctum
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan migrate

# Start server
php artisan serve

Quick test with curl:

# Test root endpoint
curl http://localhost:8000/api

# Create a user
curl -X POST http://localhost:8000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"name":"Test User","email":"test@example.com","password":"password123","password_confirmation":"password123"}'

# Login
curl -X POST http://localhost:8000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"password123"}'

Estimated time: 10-15 minutes


4. E-commerce Shop ⭐⭐⭐

# Navigate to the project
cd projects/shop-app

# Install dependencies
composer install

# Configure environment
cp .env.example .env
php artisan key:generate

# Configure database
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

# Create database file
touch database/database.sqlite

# Run migrations
php artisan migrate

# Install Breeze
composer require laravel/breeze --dev
php artisan breeze:install blade

# Install frontend assets
npm install
npm run build

# Create symbolic link
php artisan storage:link

# Start server
php artisan serve

Quick test:

  1. Open http://localhost:8000
  2. Create a user account
  3. Add products to cart
  4. Test checkout process
  5. Manage orders

Note: Stripe payments require additional configuration.

Estimated time: 15-20 minutes


5. Wizard Form ⭐⭐⭐

# Navigate to the project
cd projects/wizard-form

# Install dependencies
composer install

# Configure environment
cp .env.example .env
php artisan key:generate

# Configure database
echo "DB_CONNECTION=sqlite" >> .env
echo "DB_DATABASE=database/database.sqlite" >> .env

# Create database file
touch database/database.sqlite

# Run migrations
php artisan migrate

# Install Breeze
composer require laravel/breeze --dev
php artisan breeze:install blade

# Install frontend assets
npm install
npm run build

# Create symbolic link
php artisan storage:link

# Start server
php artisan serve

Quick test:

  1. Open http://localhost:8000
  2. Create a user account
  3. Create a multi-step form
  4. Add fields with validation
  5. Publish and test the form

Estimated time: 15-20 minutes


πŸ”§ Advanced Configuration

MySQL/PostgreSQL Database

If you prefer to use MySQL or PostgreSQL:

# Create database
mysql -u root -p -e "CREATE DATABASE laravel_project CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# Configure .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_project
DB_USERNAME=root
DB_PASSWORD=your_password

Stripe Configuration (Shop App)

# Get Stripe keys from https://dashboard.stripe.com/test/apikeys
STRIPE_KEY=pk_test_your_public_key
STRIPE_SECRET=sk_test_your_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret

πŸ§ͺ Automated Tests

Run all tests

# For each project
cd projects/[project-name]
php artisan test

Specific tests

# Feature tests
php artisan test --testsuite=Feature

# Unit tests
php artisan test --testsuite=Unit

# Specific tests
php artisan test --filter=UserTest

πŸš€ Quick Deployment

# Install Heroku CLI
# https://devcenter.heroku.com/articles/heroku-cli

# Create application
heroku create my-laravel-project

# Configure environment variables
heroku config:set APP_KEY=base64:$(php artisan key:generate --show)
heroku config:set DB_CONNECTION=postgresql

# Deploy
git push heroku main

# Run migrations
heroku run php artisan migrate

Vercel (Alternative)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

πŸ“Š Project Comparison

Project Complexity Installation time Key features
Todo App ⭐ 5-10 min CRUD, Filters, Validation
Blog Platform ⭐⭐ 10-15 min Auth, Upload, Relations
REST API ⭐⭐ 10-15 min API, Sanctum, Resources
Shop App ⭐⭐⭐ 15-20 min E-commerce, Stripe, Cart
Wizard Form ⭐⭐⭐ 15-20 min Forms, Conditional logic

🎯 Recommendations

For beginners:

  1. Todo Application - Perfect for understanding basics
  2. Blog Platform - Good for authentication and relations

For progression:

  1. REST API - Excellent for APIs
  2. E-commerce Shop - Complex but complete
  3. Wizard Form - Advanced with conditional logic

πŸ” Troubleshooting

Common problems

Permission error

# Give permissions
chmod -R 775 storage
chmod -R 775 bootstrap/cache

Database error

# Check connection
php artisan tinker
DB::connection()->getPdo();

# Reset migrations
php artisan migrate:fresh

Cache error

# Clear all caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear

Dependency error

# Reinstall dependencies
composer install --no-cache
npm install --no-cache

πŸ“š Additional Resources

Official documentation

Testing tools

Databases

πŸŽ‰ Conclusion

You now have:

Next steps:

  1. Test each project in order of complexity
  2. Customize according to your needs
  3. Add additional features
  4. Deploy to production
  5. Create your own projects using these concepts

Happy Laravel exploration! πŸš€

Don’t forget to consult the detailed tutorials in each project folder for complete instructions.