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

Schema Org Laravel Package

becklyn/schema-org

View on GitHub
Deep Wiki
Context7

Getting Started

Install the package via Composer:

composer require vendor/package-name

For Laravel projects, publish the config file (if applicable) and register the service provider in config/app.php under providers. The package now supports PHP 8 and Symfony 6, so ensure your environment aligns with these requirements.

First Use Case: Leverage the package’s core functionality (e.g., dependency injection, utilities, or Symfony integration) by autowiring services or using facades. Example:

use Vendor\Package\Services\ExampleService;

class MyController extends Controller
{
    public function __construct(private ExampleService $exampleService) {}
}

Implementation Patterns

Core Workflows

  1. Dependency Injection: Bind interfaces to implementations in AppServiceProvider or use Laravel’s autowiring. Example:

    $this->app->bind(
        Vendor\Package\Contracts\ExampleInterface::class,
        Vendor\Package\Services\ExampleService::class
    );
    
  2. Symfony Integration: Use Symfony components (e.g., HttpClient, Cache) via the package’s wrappers. Example:

    use Vendor\Package\Symfony\CacheAdapter;
    
    $cache = new CacheAdapter();
    $cache->set('key', 'value');
    
  3. Configuration: Customize behavior via config/package-name.php. The package now enforces strict typing (PHP 8), so ensure your config adheres to defined return types.

Extension Points

  • Service Extenders: Override default services by binding interfaces in AppServiceProvider.
  • Middleware: Add middleware to the package’s routes (if applicable) via Laravel’s middleware stack.

Gotchas and Tips

Breaking Changes

  • Symfony 4.4 Dropped: Remove any references to symfony/*:4.4 in composer.json or code.
  • Strict Typing: PHP 8’s return types must be respected. Update method signatures if extending the package.

Debugging

  • Type Errors: If using PHP 8, enable strict_types=1 in composer.json to catch type mismatches early.
  • Symfony Deprecations: The package fixes internal Symfony deprecations, but custom integrations may still trigger warnings. Use symfony/flex or symfony/var-dumper for debugging.

Performance Tips

  • Caching: Leverage Symfony’s CacheAdapter for performance-critical operations.
  • GitHub Actions: CI/CD pipelines now use GitHub Actions (replacing TravisCI), which may require updating workflow files if you forked the package.

Quirks

  • Autowiring Conflicts: If the package and your app define the same class, explicitly bind the package’s version in AppServiceProvider.
  • Config Validation: The package may validate config keys more strictly with PHP 8. Use php artisan config:clear if issues arise.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky