This guide allows you to quickly test all 5 Laravel projects created in this book.
Before starting, make sure you have:
curl
, mbstring
, xml
, zip
, gd
# Check PHP
php --version
# Check Composer
composer --version
# Check Node.js
node --version
# Check Git
git --version
# If you don't have the project yet
git clone <repository-url>
cd "Laravel From Zero to Production"
# 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
# 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:
Estimated time: 5-10 minutes
# 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:
Estimated time: 10-15 minutes
# 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
# 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:
Note: Stripe payments require additional configuration.
Estimated time: 15-20 minutes
# 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:
Estimated time: 15-20 minutes
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
# 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
# For each project
cd projects/[project-name]
php artisan test
# Feature tests
php artisan test --testsuite=Feature
# Unit tests
php artisan test --testsuite=Unit
# Specific tests
php artisan test --filter=UserTest
# 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
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
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 |
# Give permissions
chmod -R 775 storage
chmod -R 775 bootstrap/cache
# Check connection
php artisan tinker
DB::connection()->getPdo();
# Reset migrations
php artisan migrate:fresh
# Clear all caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Reinstall dependencies
composer install --no-cache
npm install --no-cache
You now have:
Happy Laravel exploration! π
Donβt forget to consult the detailed tutorials in each project folder for complete instructions.