draw/core
Core utilities for Draw components/bundles. Provides reusable shared code and automatically registers missing Draw-namespaced Doctrine annotations as ignored to prevent annotation reader errors when optional annotation libraries aren’t installed.
AnnotationReader, it integrates seamlessly with Laravel applications using Doctrine ORM, Symfony bridges, or annotation-based configurations (e.g., validation, caching). This makes it ideal for enterprise Laravel apps or legacy Symfony migrations.draw ecosystem, this package serves as a foundational layer, reducing technical debt for shared annotation logic. For standalone Laravel apps, it provides a lightweight alternative to manual ignore-annotations configuration.doctrine/annotations, integration is immediate. If not, the package can be gated behind a feature flag or lazy-loaded to avoid overhead.ignore_annotations.php config is misconfigured. Requires rigorous testing with real-world annotation use cases.composer.json.draw ecosystem evolves.spatie/laravel-activitylog, this lacks Laravel-specific documentation or service provider templates.Annotation Strategy:
Alternatives Assessment:
AnnotationRegistry or Laravel-specific annotation tool (e.g., illuminate/support wrappers) that could serve the same purpose?ignore-annotations configuration in doctrine/annotations be simpler for the team’s use case?Configuration Management:
ignore_annotations.php be version-controlled and shared across dev/staging/prod environments?Testing and Validation:
Long-Term Viability:
draw ecosystem?doctrine/annotations (common in Laravel via packages like laravel-doctrine or symfony/doctrine-bridge).DrawCoreServiceProvider), leveraging Laravel’s binding and booting mechanisms.AnnotationReader or Laravel’s extended readers (if used).AnnotationReader is detected via class_exists()).phpstan or psalm to identify all annotation usages (e.g., use Doctrine\ORM\Mapping\*).composer require draw/core doctrine/annotations
// app/Providers/DrawCoreServiceProvider.php
namespace App\Providers;
use Draw\Core\AnnotationIgnorer;
use Illuminate\Support\ServiceProvider;
class DrawCoreServiceProvider extends ServiceProvider {
public function register() {
$this->app->singleton(AnnotationIgnorer::class, function ($app) {
return new AnnotationIgnorer(require __DIR__.'/../../config/draw/ignore_annotations.php');
});
}
public function boot() {
$this->app->make(AnnotationIgnorer::class)->register();
}
}
config/app.php.config/draw/ignore_annotations.php based on the app’s needs (e.g., ignore Some\Legacy\Annotation).ignore-annotations in doctrine/annotations config files.'draw_core' => [
'enabled' => env('DRAW_CORE_ENABLED', true),
]
doctrine/annotations version (e.g., ^1.13). Pin versions in composer.json to avoid conflicts.doctrine/annotations is installed and AnnotationReader is in use.ignore_annotations.php and test with low-risk components.draw/core:^1.0).ignore_annotations.php must be kept in sync across environments. Use CI/CD validation (e.g., a script to check for syntax errors).draw/core for security updates (though MIT license reduces legal risk).AnnotationReader fails, check ignored namespaces").## Debugging Annotation Errors
1. Check `storage/logs/laravel.log` for `AnnotationException`.
2. Verify `ignore_annotations.php` includes the problematic namespace.
3
How can I help you explore Laravel packages today?