Database Migrations
Version control for your database with dependency resolution, rollbacks, and batch tracking
Full-featured ORM with models, relationships, migrations, and schema builder - Your complete database solution for PHP
use Bob\Database\Connection;
// Configure your connection
$connection = new Connection([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'myapp',
'username' => 'root',
'password' => 'password',
]);
// Start building queries
$users = $connection->table('users')
->where('status', 'active')
->orderBy('created_at', 'desc')
->limit(10)
->get();use Bob\Database\Model;
class Post extends Model
{
protected string $table = 'posts';
public static function findBySlug(string $slug): ?self
{
$result = static::query()
->where('slug', $slug)
->first();
return $result ? static::hydrate($result) : null;
}
}
// Use your custom methods
$post = Post::findBySlug('hello-world');Bob Query Builder was born from the need for a powerful, standalone query builder that could enhance Quantum ORM's capabilities. But it quickly evolved into something more - a fully independent, framework-agnostic solution that brings Laravel's elegant query building to any PHP project.
Install Bob via Composer:
composer require marwen-brini/bob-the-builderThat's it! No complex configuration or bootstrapping required.
Join our growing community of developers using Bob Query Builder: