laravel/database
Bring Laravel’s database layer to non-Laravel projects: Illuminate Database with migrations, seeders, and Artisan CLI support. Includes Eloquent ORM, query builder, schema tools, and commands like migrate, db:seed, and make:* for MySQL/Postgres/SQL Server/SQLite.
illuminate/database to provide Laravel’s database capabilities (migrations, seeding, Eloquent ORM) in non-Laravel PHP projects. This is a high-fit for projects requiring structured database management without full Laravel overhead.illuminate/database, meaning it can coexist with other ORMs or query builders if needed.illuminate/database (~20MB) and PHP 8.0+. No Laravel-specific services (e.g., service container, routing) are mandatory.artisan CLI tool is self-contained but requires PHP’s built-in CLI. Projects must ensure their environment supports it (e.g., no JS-only deployments)..env setup (no Laravel’s config/cache).RefreshDatabase) may not integrate seamlessly with non-Laravel test suites (e.g., PHPUnit + DBAL).illuminate/database and laravel/database via Composer.config/database.php (minimal setup; no need for Laravel’s full config).php artisan migrate manually).vendor/bin/artisan or a wrapper script).php artisan migrate --force).illuminate/database (MySQL, PostgreSQL, SQLite, SQL Server). Check for unsupported features (e.g., MariaDB-specific functions).illuminate/* packages (e.g., illuminate/support)..env files. Use a library like vlucas/phpdotenv if the project lacks one.php artisan migrate in CI/CD pipelines.db:seed and db:wipe commands.illuminate/database is battle-tested in Laravel.illuminate/database.| Risk | Impact | Mitigation |
|---|---|---|
| Migration Conflicts | Schema corruption if migrations run out of order. | Use migrate:status to track runs; enforce CI checks. |
| Artisan CLI Unavailable | Production deployments without CLI access. | Use web-based alternatives (e.g., custom API endpoints for migrations). |
| Eloquent Model Issues | N+1 queries or unexpected behavior in non-Laravel context. | Use ->toBase() for raw queries; profile performance. |
| Dependency Updates | Breaking changes in illuminate/database. |
Pin versions in composer.json; monitor Laravel’s deprecations. |
| Schema Drift | Manual SQL changes bypass migrations. | Enforce migration-first workflows; use migrate:fresh in tests. |
How can I help you explore Laravel packages today?