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

Laravel Url Ai Transformer Laravel Package

spatie/laravel-url-ai-transformer

Laravel package to transform URLs and their web content with AI. Extract structured data (JSON-LD), generate summaries, images, or custom outputs via transformers and prompts. Runs via an Artisan command and stores results in the database for later retrieval.

View on GitHub
Deep Wiki
Context7

title: Basic usage weight: 1

This section covers the fundamental features of the Laravel URL AI Transformer package.

Available transformers

The package ships with two powerful transformers out of the box:

LdJsonTransformer

Extracts structured data from web pages in LD+JSON format. This transformer analyzes the content and generates comprehensive structured data following Schema.org standards.

use Spatie\LaravelUrlAiTransformer\Transformers\LdJsonTransformer;

Transform::urls('https://example.com/article')
    ->usingTransformers(new LdJsonTransformer);

Perfect for:

  • SEO optimization
  • Content aggregation
  • Building knowledge graphs
  • Creating rich snippets

ImageTransformer

Generates images based on web content using AI image generation models. This transformer reads the content and creates visual representations.

use Spatie\LaravelUrlAiTransformer\Transformers\ImageTransformer;

Transform::urls('https://example.com/blog-post')
    ->usingTransformers(new ImageTransformer);

Perfect for:

  • Creating social media images
  • Generating visual summaries
  • Building image galleries from text content
  • Creating infographics

Quick start

  1. Register your transformations
  2. Get started with basic examples
  3. Use the command
  4. Write your own transformers

Common patterns

Transform multiple URLs at once

Transform::urls(
    'https://example.com/page1',
    'https://example.com/page2',
    'https://example.com/page3'
)->usingTransformers(new LdJsonTransformer);

Apply multiple transformers

Transform::urls('https://example.com/article')
    ->usingTransformers(
        new LdJsonTransformer,
        new ImageTransformer,
        new CustomSummaryTransformer
    );

Use closures for dynamic URLs

Transform::urls(
    fn() => Article::published()->pluck('url')->toArray()
)->usingTransformers(new LdJsonTransformer);
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport