Weave Code
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

Ting Laravel Package

ccmbenchmark/ting

Ting is a lightweight Laravel/PHP package from ccmbenchmark that adds simple benchmarking utilities to time and compare code paths. Use it to measure execution duration, collect results, and quickly spot slow sections during local development and profiling.

View on GitHub
Deep Wiki
Context7

Lightweight PHP datamapper

Frequently asked questions about Ting
How does Ting compare to Laravel Eloquent for performance-critical queries?
Ting is significantly lighter than Eloquent, offering direct SQL execution with minimal abstraction. It’s ideal for complex read operations or legacy systems where Eloquent’s overhead is prohibitive. Benchmark tests show Ting can outperform Eloquent in high-throughput scenarios, but lacks Eloquent’s built-in features like relationships or events.
Can Ting replace Eloquent entirely in a Laravel project?
Ting can replace Eloquent for data access layers but isn’t a drop-in solution. You’ll need to manually handle relationships, events, and Laravel-specific features. Use Ting incrementally for modules where its lightweight design provides clear benefits, while keeping Eloquent for CRUD-heavy parts of your app.
What Laravel versions does Ting support?
Ting is framework-agnostic but works with any Laravel version (5.5+) via PDO. It doesn’t rely on Laravel’s service container or facades, so version compatibility is determined by your PHP/PDO setup. Test thoroughly with your target Laravel version, as Ting lacks official Laravel-specific integration.
How do I integrate Ting with Laravel’s service container?
Ting requires manual bootstrap. Bind repositories in `AppServiceProvider::boot()` using Laravel’s container. Example: `$app->bind('CityRepository', function($app) { return new CityRepository($app['db']); });`. This approach aligns with Laravel’s DI but requires more setup than Eloquent’s auto-discovery.
Does Ting support Laravel migrations or schema management?
No, Ting doesn’t include migration tools. Use Laravel’s native migrations for schema changes. Ting focuses solely on data mapping and query execution, leaving schema management to Laravel’s built-in system. This separation is intentional to keep Ting lightweight.
How does Ting handle relationships between entities?
Ting doesn’t support Eloquent-style relationships (e.g., `hasOne`, `belongsTo`). Relationships must be manually resolved in repository logic. For example, fetch a `User` and then query a `PostRepository` separately. This requires more code but offers full control over join logic and performance.
Is Ting suitable for microservices with multiple database connections?
Yes, Ting’s PDO-based design works seamlessly with Laravel’s multiple database connections. Each repository can target a specific connection, making it ideal for microservices where services may need isolated data access. Configure connections in Laravel’s `config/database.php` as usual.
How do I test Ting repositories in PHPUnit?
Test Ting repositories by mocking the PDO connection or using Laravel’s database testing tools. Example: `$this->app->instance('db', $mockPdo);`. Since Ting lacks Eloquent’s testing helpers, you’ll need to manually verify query execution and results. Focus on unit testing repository methods and edge cases.
Are there alternatives to Ting for lightweight data mapping in Laravel?
Alternatives include Laravel’s Repository pattern (DIY), packages like `Laravel-Repository`, or `Doctrine ORM` for heavier needs. Ting stands out for its minimalist design and direct SQL access, but lacks community support. Evaluate based on your need for flexibility vs. Eloquent’s built-in features.
What’s the maintenance status of Ting? Should I use it in production?
Ting has low GitHub activity (2 stars) and no recent commits, suggesting niche or experimental use. Assess its fit for your project’s risk tolerance. For production, thoroughly test Ting’s edge cases, especially with complex queries or high concurrency. Consider forking or extending it if critical features are missing.
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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver