Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Codeigniter4 Eloquent Laravel Package

nabcellent/codeigniter4-eloquent

Brings Laravel's Eloquent ORM to CodeIgniter 4, letting you use models, relationships, and fluent query building alongside CI4's database layer. A lightweight integration for developers who prefer Eloquent's expressive syntax.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require and, if the package exposes them, publish config and migrations:
    • php artisan vendor:publish --tag=config
    • php artisan vendor:publish --tag=migrations
  • Start with the package’s service provider and config file. These show the default driver, connection name, and table/model bindings.
  • For database-backed usage, confirm your .env has a valid DB_CONNECTION and run php artisan migrate before exercising the package.
  • First use case: configure the database driver, run migrations, then perform a single write/read through the package’s facade, helper, or repository to validate the connection and schema.
  • If you are on PHP 8.0 or below, use v1.1.7 or later; this release specifically fixes database support for those runtimes.

Implementation Patterns

  • Database driver setup: explicitly set the package’s driver to database (or equivalent) and point it at a connection/table in config rather than relying on defaults.
  • Migrations as part of deployment: treat published migrations like application migrations. Run them in deploy scripts and include them in CI setup.
  • Repository/service wrapping: inject the package’s store or repository into your own service classes instead of calling the facade directly from controllers. This keeps the database dependency testable.
  • Testing: use an in-memory SQLite connection for fast tests, and run migrations in setUp() or via RefreshDatabase. Add at least one integration test that hits the real database driver.
  • Multiple connections: configure a dedicated connection if the package’s tables should live outside your primary application database. Verify the package respects the connection name in config.
  • Caching layer: if the package reads frequently, wrap reads in Cache::remember() and invalidate on writes. Do not assume the package handles caching automatically.
  • PHP version matrix: if you support PHP 8.0 and below alongside newer versions, include those runtimes in CI. This release is directly relevant to that matrix.

Gotchas and Tips

  • PHP 8-and-below fix: v1.1.7 is a patch release, but verify it on your exact PHP version. Run composer why-not php and check the package’s composer.json platform constraints.
  • Migrations may already be published: after upgrading, re-check whether the package’s migrations changed. Do not edit vendor files; republish only if the package documents new migration tags.
  • Config caching: run php artisan config:clear after changing driver, connection, or table settings. Stale cached config is a common cause of “database driver not working” reports.
  • Table name collisions: if the package uses a generic table name, override it in config to avoid conflicts with existing application tables.
  • Transaction boundaries: if you write through the package inside a larger transaction, confirm the package uses the same connection; otherwise writes may land outside your rollback.
  • Debugging queries: enable DB::listen() or Laravel Telescope/query log temporarily to confirm the package is hitting the expected connection and table.
  • Extension points: prefer publishing config and overriding the bound model/store class over forking the package. Check the service provider for bindings you can swap.
  • Version pinning: pin to ^1.1.7 if you rely on database support on PHP 8.0 or below, and document that minimum in your project’s README.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle