The Modern PHP Framework
Brickhouse brings the modern development approach to PHP, allowing for expressive and readable syntax. It contains all the stuff you need, and none of the stuff you don't.
<?php
namespace App\Controllers;
use App\Models\Post;
use Brickhouse\Http\Controller;
use Brickhouse\Http\Response;
final class PostController extends Controller
{
public function index(): Response
{
return render('posts/index', [
'posts' => Post::all()
]);
}
public function show(int $id): Response
{
return render('posts/show', [
'post' => Post::find($id)
]);
}
}
<?php
use Brickhouse\Http\Router;
Router::root(fn() => render('index'));
Router::get('greeting', \App\Controllers\GreetingController::class);