TL;DR: I built Lighthouse PHP Framework because modern frameworks got too complex. It lets you handle forms in views (like PHP intended), uses SQLite out of the box, includes security by default, and gets you productive in 30 seconds. No controllers, no magic, just productive PHP development.TL;DR: I built Lighthouse PHP Framework because modern frameworks got too complex. It lets you handle forms in views (like PHP intended), uses SQLite out of the box, includes security by default, and gets you productive in 30 seconds. No controllers, no magic, just productive PHP development.

Tired of Learning 50 New Concepts to Build a Form? Say Hello to Lighthouse for PHP

2025/12/04 14:22

Building modern web apps shouldn't require learning 50 new concepts. Sometimes you just want to write PHP.

The Problem with Modern PHP Frameworks

Don't get me wrong—Laravel, Symfony, and other frameworks are incredible. But sometimes you're building a simple web app and you find yourself:

  • 📚 Reading documentation for hours just to create a basic form
  • 🔧 Configuring dozens of services you don't need
  • 🐘 Fighting with complex abstractions for simple tasks
  • ⚡ Waiting for slow development servers to restart

What if there was a better way?

Meet Lighthouse 🚨

Lighthouse is a minimal, predictable PHP micro-framework that embraces the simplicity PHP was meant for. It's designed around one core principle: get productive immediately.

<?php // That's it. Your first route. route('/', function() { return view('home.php', ['message' => 'Hello World!']); });

Why Lighthouse is Different

1. Logic Where It Makes Sense

Instead of forcing everything through controllers, Lighthouse lets you handle form logic directly in views—the way PHP was designed:

<?php // views/contact.php $errors = []; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = sanitize_email($_POST['email']); $message = sanitize_string($_POST['message']); if (!validate_email($email)) { $errors[] = 'Invalid email'; } if (empty($errors)) { db_insert('contacts', ['email' => $email, 'message' => $message]); $success = 'Message sent!'; } } ?> <form method="POST"> <?php if ($success ?? false): ?> <div class="success"><?= $success ?></div> <?php endif; ?> <input type="email" name="email" required> <textarea name="message" required></textarea> <button type="submit">Send</button> </form>

Self-contained. Predictable. No magic.

2. Modern Stack, Zero Configuration

  • PHP 8+ with type hints and modern features
  • SQLite for zero-config databases
  • HTMX for dynamic interactions
  • Pico.css for beautiful, minimal styling

# Get started in 30 seconds lighthouse new my-app cd my-app php -S localhost:8000 -t public/

3. Security by Default

// CSRF protection built-in <?= csrf_field() ?> // Input sanitization included $clean_input = sanitize_string($_POST['data']); // Rate limiting ready if (!check_rate_limit($_SERVER['REMOTE_ADDR'])) { // Handle rate limit }

4. Database Operations That Make Sense

// Simple, predictable database operations $users = db_select('users', ['active' => 1]); $user_id = db_insert('users', ['name' => $name, 'email' => $email]); db_update('users', ['last_login' => date('Y-m-d H:i:s')], ['id' => $user_id]);

Real-World Example: Authentication in 5 Minutes

Here's how you build a complete login system:

<?php // routes.php route('/login', function() { return view('login.php'); }); route('/dashboard', function() { if (!auth_user()) { header('Location: /login'); exit; } return view('dashboard.php'); });

<?php // views/login.php if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = sanitize_email($_POST['email']); $password = $_POST['password']; $user = db_select_one('users', ['email' => $email]); if ($user && auth_verify_password($password, $user['password'])) { auth_login($user['id']); header('Location: /dashboard'); exit; } $error = 'Invalid credentials'; } ?> <form method="POST"> <?php if ($error ?? false): ?> <div class="error"><?= $error ?></div> <?php endif; ?> <input type="email" name="email" required> <input type="password" name="password" required> <?= csrf_field() ?> <button type="submit">Login</button> </form>

That's it. No controllers, no middleware configuration, no service providers. Just PHP doing what PHP does best.

When to Use Lighthouse

Lighthouse shines when you're building:

  • 🚀 MVPs and prototypes - Get to market fast
  • 📊 Internal tools and dashboards - No need for complexity
  • 🏢 Small business websites - Contact forms, simple e-commerce
  • 🎓 Learning projects - Focus on concepts, not framework magic
  • 🔧 API backends - Lightweight and fast

The Philosophy

Lighthouse embraces pragmatic PHP development:

  • Start simple - Use logic in views for rapid development
  • Refactor when needed - Move to more complex patterns as you grow
  • Choose what fits - Multiple approaches supported
  • Stay productive - Don't over-engineer simple problems

Getting Started

# Install the CLI bash -c "$(curl -fsSL https://raw.githubusercontent.com/max-yterb/Lighthouse/main/scripts/install.sh)" # Create your first app lighthouse new my-awesome-app cd my-awesome-app # Start building php -S localhost:8000 -t public/

What's Next?

Lighthouse is actively developed with a focus on:

  • 🔐 Enhanced authentication providers (OAuth, SAML)
  • 🗄️ Multiple database support (MySQL, PostgreSQL)
  • ⚡ Performance monitoring tools
  • 📱 Advanced HTMX integration patterns

Try It Today

If you're tired of complex frameworks for simple projects, give Lighthouse a try. It might just remind you why you fell in love with PHP in the first place.

  • 📖 Documentation: max-yterb.github.io/Lighthouse
  • 💻 GitHub: github.com/max-yterb/Lighthouse
  • 💬 Discussions: GitHub Discussions

What do you think? Are you ready to try a framework that gets out of your way? Drop a comment below with your thoughts on modern PHP development!

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact [email protected] for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Suspected $243M Crypto Hacker Arrested After Major Breakthrough in Global Heist

Suspected $243M Crypto Hacker Arrested After Major Breakthrough in Global Heist

Major breakthrough in $243M crypto heist as suspect arrested! $18.58M in crypto seized, linked to suspected hacker’s wallet. Dubai villa raid leads to possible arrest of crypto thief. A major breakthrough in the investigation into the $243 million crypto theft has emerged, as blockchain investigator ZachXBT claims that a British hacker, suspected of orchestrating one of the largest individual thefts in crypto history, may have been arrested. On December 5, ZachXBT revealed in a Telegram post that Danny (also known as Meech or Danish Zulfiqar Khan), the primary suspect behind the attack, was likely apprehended by law enforcement. ZachXBT pointed to a significant find: approximately $18.58 million worth of crypto currently sitting in an Ethereum wallet linked to the suspect. The investigator claimed that several addresses connected to Zulfiqar had consolidated funds to this address, mirroring patterns previously seen in law enforcement seizures. This discovery has raised suspicions that authorities may have closed in on the hacker. Moreover, ZachXBT mentioned that Zulfiqar was last known to be in Dubai, where it is alleged that a villa was raided, and multiple individuals associated with the hacker were arrested. He also noted that several contacts of Zulfiqar had gone silent in recent days, adding to the growing belief that law enforcement had made a major move against the hacker. However, no official statements from Dubai Police or UAE regulators have confirmed the arrest, and local media reports remain silent on the matter. Also Read: Song Chi-hyung: The Visionary Behind Upbit and the Future of Blockchain Innovation The $243 Million Genesis Creditor Heist: How the Attack Unfolded The arrest of Zulfiqar may be linked to one of the largest known individual crypto heists. In September 2024, ZachXBT uncovered that three attackers were involved in stealing 4,064 BTC (valued at $243 million at the time) from a Genesis creditor. The attack was carried out using sophisticated social engineering tactics. The hackers impersonated Google support to trick the victim into resetting two-factor authentication on their Gemini account, giving them access to the victim’s private keys. From there, they drained the wallet, moving the stolen BTC through a complex network of exchanges and swap services. ZachXBT previously identified the suspects by their online handles, “Greavys,” “Wiz,” and “Box,” later tying them to individuals Malone Lam, Veer Chetal, and Jeandiel Serrano. The U.S. Department of Justice later charged two of the suspects with orchestrating a $230 million crypto scam involving the theft. Further court documents revealed that the criminals had used a mix of SIM swaps, social engineering, and even physical burglaries to carry out the theft, spending millions on luxury items like cars and travel. ZachXBT’s tracking work has played a key role in uncovering several related thefts, including a $2 million scam in which Chetal was involved while out on bond. The news of Zulfiqar’s potential arrest could mark a significant turning point in the investigation, although full details are yet to emerge. Also Read: Kevin O’Leary Warns: Only Bitcoin and Ethereum Will Survive Crypto’s Reality Check! The post Suspected $243M Crypto Hacker Arrested After Major Breakthrough in Global Heist appeared first on 36Crypto.
Share
Coinstats2025/12/06 18:27