Skip to content

dalehurley/codewithphp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

319 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Code with PHP

A comprehensive, open-source learning platform helping developers fall in love with PHP and its ecosystem.

🌐 Live Site: codewithphp.com
πŸ‘€ Author: Dale Hurley
πŸ“„ License: MIT

🎯 About

Code with PHP is a tutorial-based learning resource featuring hands-on, reproducible tutorials for modern PHP development. Every code sample is tested, every chapter is production-ready, and every tutorial is designed to teach real-world skills.

Tutorial Series

  1. PHP Basics β€” Master PHP fundamentals from zero to hero
  2. AI/ML for PHP Developers β€” Build machine learning applications with PHP
  3. Build a CRM with Laravel 12 β€” Build a complete CRM system with Laravel 12
  4. Claude for PHP Developers β€” Integrate Claude AI into PHP applications
  5. Data Science for PHP Developers β€” Data analysis and visualization with PHP
  6. PHP Algorithms β€” Master algorithms and data structures in PHP
  7. PHP for Java Developers β€” Transition from Java to PHP
  8. PHP for TypeScript Developers β€” Transition from TypeScript to PHP
  9. Python Developers β™₯ PHP & Laravel β€” Transition from Python to PHP/Laravel
  10. Ruby on Rails Developers β™₯ Laravel β€” Transition from Rails to Laravel

πŸš€ Quick Start

Documentation Site

# Install dependencies
npm install

# Start development server (http://localhost:4321)
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Testing Code Samples

All tutorial code is validated in the testing/ directory before publication.

cd testing

# Run all tests
php test-all-samples.php

# View test results
cat TEST-SUMMARY-REPORT.md

Current Test Status: 96/119 passing (80.7%) πŸŽ‰

πŸ“ Project Structure

PHP-From-Scratch/
β”œβ”€β”€ src/                     # Astro Starlight documentation site
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   β”œβ”€β”€ docs/           # Tutorial content
β”‚   β”‚   β”‚   β”œβ”€β”€ index.mdx   # Landing page
β”‚   β”‚   β”‚   └── series/     # Tutorial series content
β”‚   β”‚   β”‚       β”œβ”€β”€ php-basics/
β”‚   β”‚   β”‚       β”œβ”€β”€ ai-ml-php-developers/
β”‚   β”‚   β”‚       β”œβ”€β”€ build-crm-laravel-12/
β”‚   β”‚   β”‚       β”œβ”€β”€ claude-php-developers/
β”‚   β”‚   β”‚       β”œβ”€β”€ data-science-php-developers/
β”‚   β”‚   β”‚       β”œβ”€β”€ php-algorithms/
β”‚   β”‚   β”‚       β”œβ”€β”€ php-for-java-developers/
β”‚   β”‚   β”‚       β”œβ”€β”€ php-typescript-developers/
β”‚   β”‚   β”‚       β”œβ”€β”€ python-developers-love-php-laravel/
β”‚   β”‚   β”‚       └── rails-developers-love-laravel/
β”‚   β”‚   └── config.ts       # Content collections configuration
β”‚   β”œβ”€β”€ styles/             # Custom CSS
β”‚   └── Head.astro          # Custom head component
β”‚
β”œβ”€β”€ code/                    # Executable code samples (organized by series)
β”‚   β”œβ”€β”€ php-basics/
β”‚   β”œβ”€β”€ ai-ml-php-developers/
β”‚   └── [other series]/
β”‚
β”œβ”€β”€ testing/                 # Test infrastructure for code validation
β”‚   β”œβ”€β”€ test-all-samples.php
β”‚   └── TEST-SUMMARY-REPORT.md
β”‚
β”œβ”€β”€ imagen/                  # AI image generation (MCP server)
β”‚   β”œβ”€β”€ src/               # Gemini 2.5 Flash integration
β”‚   └── output/            # Generated hero images
β”‚
β”œβ”€β”€ public/                  # Static assets
β”‚   β”œβ”€β”€ images/            # Hero images and graphics
β”‚   └── social/            # Social media preview images
β”‚
β”œβ”€β”€ scripts/                # Utility scripts
β”‚   β”œβ”€β”€ generate-social-images.js
β”‚   └── update-code-references.js
β”‚
└── astro.config.mjs        # Astro & Starlight configuration

πŸ› οΈ Tech Stack

Documentation Site

  • Astro 5 β€” Modern static site generator with component islands
  • Starlight β€” Astro's documentation theme with built-in features
  • TypeScript β€” Type-safe configuration
  • MDX β€” Enhanced markdown with component support
  • GitHub Pages β€” Hosting & deployment

Image Generation

  • Google Gemini 2.5 Flash β€” AI image generation
  • MCP (Model Context Protocol) β€” Claude Desktop integration
  • Node.js β€” Image processing pipeline

πŸ“ Contributing

We welcome contributions! Here's how to get started:

  1. Content Contributions

    • Edit pages via the "Edit this page" link on any chapter
    • Follow authoring guidelines in .cursor/rules/
    • All code samples must pass tests in testing/
  2. Code Quality Standards

    • PHP 8.4+ compatible
    • PSR-12 coding standards
    • Complete, runnable examples (no partial code)
    • Proper error handling and type hints
  3. Testing Requirements

    • Copy code to testing/<series-name>/
    • Run php test-all-samples.php
    • Document expected failures if applicable

Authoring Guidelines

Key rules documents:

🎨 Features

For Learners

  • βœ… Progress Tracking β€” Built-in chapter completion tracking
  • πŸ” Full-Text Search β€” Search across all tutorials
  • πŸ“± Mobile-Friendly β€” Responsive design for learning on the go
  • 🎯 Hands-On Code β€” Every example is tested and runnable
  • πŸ”— Deep Linking β€” Share specific sections with others

For Contributors

  • πŸ§ͺ Automated Testing β€” Validate all code samples before publish
  • 🎨 Image Generation β€” AI-generated hero images for chapters
  • πŸ”„ Real-Time Preview β€” See changes instantly

πŸ”— Links

πŸ“Š Project Status

  • PHP Basics: βœ… Complete (25 chapters)
  • AI/ML for PHP Developers: βœ… Complete (25 chapters)
  • Build a CRM with Laravel 12: 🚧 In Progress (40 chapters planned)
  • Claude for PHP Developers: 🚧 In Progress (40 chapters planned)
  • Data Science for PHP Developers: πŸ†• Starting
  • PHP Algorithms: 🚧 In Progress (38 chapters planned)
  • PHP for Java Developers: 🚧 In Progress (23 chapters planned)
  • PHP for TypeScript Developers: πŸ†• Starting (16 chapters planned)
  • Python β†’ PHP/Laravel: 🚧 In Progress (11 chapters)
  • Rails β†’ Laravel: 🚧 In Progress (11 chapters)
  • Code Test Coverage: 80.7% passing (96/119 samples)
  • Active Development: βœ… Ongoing

πŸ“„ License

MIT License β€” See LICENSE for details.


Built with ❀️ by Dale Hurley

About

Code with PHP series cover different topics coded using PHP. From beginning to advanced.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors