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

Data Laravel Package

atk4/data

ATK Data is a PHP data model abstraction that separates business logic from UI and persistence. Works with SQL/NoSQL/APIs, supports relations, expressions, aggregation, and user actions with ACL metadata—integrates easily with ATK UI and ATK API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy for rapid development of data-centric applications (e.g., admin panels, reporting tools, or SaaS platforms) where abstraction and extensibility are critical. Avoid reinventing a data layer from scratch.
  • Roadmap Acceleration: Enable low-code UI generation (e.g., CRUD, grids, forms) with minimal boilerplate, reducing frontend-backend integration time by 70%+.
  • Multi-Persistence Strategy: Unify SQL, NoSQL, and API data sources under a single model layer, simplifying migrations or hybrid architectures (e.g., caching layers, legacy system integration).
  • Use Cases:
    • Admin Dashboards: Auto-generate CRUD interfaces for business objects (e.g., Client, Invoice) with 3 lines of code.
    • Complex Reports: Build aggregated analytics (e.g., "Job Profitability") without SQL queries in application logic—push computation to the database.
    • SaaS Multi-Tenancy: Enforce row-level security (e.g., user_id filters) globally across all models with zero manual checks.
    • Legacy Refactoring: Decouple UI from database schema changes (e.g., denormalize profit field) without breaking existing features.
    • API-First Projects: Pair with Agile API to expose models as REST endpoints with built-in validation/ACL.

When to Consider This Package

Adopt If:

  • Your app requires database-agnostic data access (switching from MySQL to PostgreSQL or adding Redis caching should be trivial).
  • You’re building admin panels or internal tools where CRUD operations are repetitive—ATK UI reduces this to configuration.
  • Reporting/analytics involve complex joins/aggregations, and you want to avoid SQL in business logic.
  • You need multi-tenancy or row-level security without manual ACL checks per query.
  • Your team prioritizes developer velocity over micro-optimizations (e.g., JOIN vs. subqueries).
  • You’re using Laravel and want to integrate ATK Data via laravel-ad.

Look Elsewhere If:

  • You’re building a highly optimized performance-critical app (e.g., real-time bidding) where ORM overhead is unacceptable—use raw SQL or a micro-ORM like Cycle ORM.
  • Your stack is non-PHP (e.g., Node.js, Python)—this is PHP-first.
  • You need active maintenance from a large community (ATK has ~300 stars but smaller than Doctrine/Eloquent).
  • Your use case is simple CRUD with no reporting/UI needs—consider Eloquent or a lighter ORM.
  • You require GraphQL out of the box (ATK’s API layer is REST-focused).

How to Pitch It (Stakeholders)

For Executives:

*"ATK Data lets us build data-driven applications 10x faster by eliminating the gap between business logic and the UI/API. Instead of writing custom SQL for every report or admin panel, we define our data models once, then generate interfaces automatically. For example:

  • Admin Panels: Replace months of CRUD development with 3 lines of code.
  • Analytics: Build complex reports (e.g., ‘Job Profitability’) without SQL in the codebase—just define relationships and aggregates.
  • SaaS Security: Enforce multi-tenancy or row-level permissions globally with zero manual checks.
  • Tech Debt: Refactor databases (e.g., add a profit column) without breaking existing features.

It’s like Laravel’s Eloquent + AdminLTE + a reporting engine, but unified. The MIT license and MIT’s performance make it risk-free to adopt for core systems."*

For Engineers:

*"ATK Data is a Data Mapper that solves the ‘ORM trap’—where your UI can’t discover your data model. Key wins:

  • Unified Data Layer: Works with SQL, NoSQL, APIs, or caches. Swap PostgreSQL for MongoDB without rewriting queries.
  • Push Logic to the Database: Define aggregates/joins in models, not SQL strings. Example:
    $job->hasMany('Timesheets')->addField('reported', [
        'aggregate' => 'sum',
        'field' => '[hours] * [hourly_rate]',
    ]);
    
    → Executes as one SQL query when rendered.
  • Low-Code UI: Pair with ATK UI to auto-generate CRUD grids, forms, or charts from your models.
  • Extensible: Add audit logs, custom field types, or ACL via hooks. Example:
    $model->addHook('beforeSave', function($m) {
        $m->set('updated_at', now());
    });
    
  • Laravel Ready: Use laravel-ad for seamless integration with existing Laravel apps.

Tradeoffs:

  • Slight learning curve (different from Eloquent).
  • Not as battle-tested as Doctrine for enterprise PHP.
  • Best for medium/large apps—overkill for tiny projects.

Next Steps:

  1. Try the Quick Start.
  2. Compare to Eloquent for a CRUD use case.
  3. Evaluate if your team prefers declarative models over imperative SQL."*
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit