Products, Orders, Customers).AbstractObject base class and IntelParserTrait enforce a consistent pattern for CRUD operations, field definitions, and data validation—aligning well with DDD principles if the Laravel app models complex business entities.Php-Bundle).EntityManager) but can be adapted for Eloquent with minimal effort (e.g., replacing repository->find() with Model::find()). The IntelParserTrait auto-discovers getters/setters, so manual mapping is reduced.SplFields (e.g., VARCHAR, EMAIL, PRICE). This is a strong fit for apps with rich data models (e.g., e-commerce, SaaS platforms).Php-Bundle provides a Symfony bridge, suggesting the package could be adapted for Laravel via a custom bundle or service container integration.IntelParserTrait relies on magic method detection (getXxx(), setXxx()), which could conflict with Laravel’s magic methods (e.g., __get(), __set()) or accessors/mutators.Splash::log()).IntelParserTrait tracks field changes to optimize DB writes. How does this compare to Laravel’s Eloquent’s touch() or queue-based updates?Product, Order).SplFields types (e.g., required(), unique()).Product) using AbstractObject and IntelParserTrait.AbstractObject for sync-only entities.update(), delete()).Splash::log()) to Laravel’s Log facade.| Laravel Feature | Compatibility | Workaround |
|---|---|---|
| Eloquent ORM | Low (assumes Doctrine) | Replace EntityManager calls with Eloquent methods (e.g., Model::find()). |
| Laravel Validation | Medium (uses SplFields) |
Map Laravel rules to SplFields (e.g., ->isRequired()). |
| Service Container | Low (no Laravel DI support) | Manually resolve dependencies or use a facade. |
| Queues/Jobs | None | Wrap sync operations in Laravel queues. |
| API Resources | Low (manual mapping required) | Use objectsList() to generate API responses. |
| Events/Observers | None | Emit Laravel events in update()/delete() methods. |
| Testing (Pest/PHPUnit) | Low (Splash-specific mocks needed) | Mock Splash::log(), IntelParserTrait methods. |
SplFields definitions (e.g., VARCHAR, PRICE).$this->fieldsFactory()->create(SplFields::PRICE)
->identifier("price")
->name("Unit Price")
->isRequired();
load(), create(), update(), delete() using IntelParserTrait.use Splash\Core\Models\Objects\IntelParserTrait;
class Product extends AbstractObject {
use IntelParserTrait;
public function load(string $id): ?ProductEntity {
return Product::find($id); // Eloquent instead of Doctrine
}
}
getXxx()/setXxx() methods.public function getPrice(): ?float {
return $this->object->price;
}
public function setPrice(float $price): void {
if ($this->object->price !== $price) {
$this->object->price = $price;
$this->needUpdate();
}
}
objectsList() to return paginated, filtered results.public function objectsList(?string $filter, array $params): array {
$query = Product::query();
if ($filter) {
$query->where('name', 'like', "%$filter%");
}
return $query->paginate($params['max'] ?? 15)->toArray();
}
How can I help you explore Laravel packages today?