Download the PHP package nexus-smart-solutions/crud-engine without Composer
On this page you can find all versions of the php package nexus-smart-solutions/crud-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nexus-smart-solutions/crud-engine
More information about nexus-smart-solutions/crud-engine
Files in nexus-smart-solutions/crud-engine
Package crud-engine
Short Description Generic CRUD services, file lifecycle management, nested relation synchronization, a statistics engine, and Laravel macros — extracted into a reusable, testable, framework-friendly package.
License MIT
Informations about the package crud-engine
Nexus CRUD Engine
Generic CRUD services, file lifecycle management, nested relation synchronization, a statistics engine, and a handful of Laravel macros — extracted from an internal framework into a standalone, testable, dependency-injected Laravel package.
Supports Laravel 10, 11, and 12, on PHP 8.2+.
Installation
The service provider and facade are auto-discovered — no manual registration needed.
Publish the config and translation files (optional):
This is equivalent to running both of:
Core Concepts
The package never assumes anything about your models' structure. Instead, your Eloquent models opt in to behavior by implementing small capability interfaces, and every generic service asks a single CapabilityRegistry what a model supports — there's no scattered instanceof checking anywhere in your application code.
| Interface | Enables |
|---|---|
Nexus\CrudEngine\Contracts\Capabilities\FileUpload |
Automatic file store/delete/URL-rewrite for declared attributes |
Nexus\CrudEngine\Contracts\Capabilities\HasManyRelations |
Automatic diff-based sync of declared hasMany relations |
Nexus\CrudEngine\Contracts\Capabilities\HasOneRelations |
Automatic update-or-create of declared hasOne relations |
Nexus\CrudEngine\Contracts\Capabilities\ManyToManyRelations |
Automatic sync() of declared belongsToMany relations |
Nexus\CrudEngine\Contracts\Capabilities\OriginalName |
Marker — keep the client's original filename instead of a hashed one |
Quick Start
1. Implement capability interfaces on your model
2. Extend the abstract Crud service for your resource
3. Use it in a controller
That's it — validation (only declared fields are persisted), file storage, and relation syncing for variants all happen automatically, in that order, with the file write deferred until after the database transaction commits.
Updating and Deleting
AbstractBulkDeleteService reads ids from the current request by default (override resolveIds() to change that), and safely handles a scalar ids value instead of throwing.
Statistics
Results are cached (crud-engine.statistics.cache_ttl, default 300 seconds). The query engine defaults to pure Eloquent (portable across MySQL/Postgres/SQLite); set crud-engine.statistics.query_strategy to spatie if you've separately installed spatie/laravel-query-builder and want its filtering conventions instead.
Macros
Available globally once the package is installed, no setup required:
Events
Subscribe to any of these instead of, or in addition to, the package's default logging listener:
RecordCreated,RecordUpdated,RecordDeleted,RecordDeletionFailedFileStored,FileDeletedRelationSynced
Disable the package's own logging listener with crud-engine.log_operations = false if you only want your own listeners.
Overriding Defaults
Every behavior described above is bound against an interface and can be swapped from your own AppServiceProvider:
Configuration
After publishing, see config/crud-engine.php for: strict_validation, strict_capabilities, files.disk, relations.max_recursion_depth, statistics.query_strategy, statistics.cache_ttl, response_formatter, and log_operations.
Testing
The test suite uses Orchestra Testbench against an in-memory SQLite database. It includes dedicated regression tests for every bug fixed during the refactor (see CHANGELOG.md) — most notably the HasOne/HasMany recursion mix-up, the validation mass-assignment gap, the orphaned-file bug, and the original-filename path-traversal fix.
License
@NexusSmartSolution.
All versions of crud-engine with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^10.0|^11.0|^12.0|^13.0
nesbot/carbon Version ^2.0|^3.0