Download the PHP package banulakwin/laravel-seo-engine without Composer

On this page you can find all versions of the php package banulakwin/laravel-seo-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-seo-engine

Laravel SEO Engine (banulakwin/laravel-seo-engine)

Latest Version on Packagist Tests Total Downloads

Portable Laravel package: a polymorphic SEO meta layer stored in seo_meta, attached to any Eloquent model via the Seoable trait. On created, a row is firstOrCreated with defaults from SeoService (config fallbacks, sensible title/description/image/canonical guesses). Existing rows are never overwritten by the package after creation—only your app or admin UI should change them.

Designed to pair cleanly with Inertia + React (<Head> tags) or plain Blade.


Requirements


Installation

Composer (path / VCS)

In a consuming app, add a path repository (or VCS) and require the package, then install:

Registration is automatic via Composer extra.laravel.providers:

Optional facade alias: SeoBanulakwin\SeoEngine\Facades\Seo.

Publish config (optional)

Tag Copies
seo-engine-config config/seo.php — defaults, canonical fallback, and migration registration
seo-engine-migrations Package migration files → database/migrations/ (optional; see below)

Database migrations (same pattern as banulakwin/laravel-page-builder)

By default, migrations are registered with loadMigrationsFrom() when config('seo.register_migrations') is true (default). Run php artisan migrate — no publish step is required.

To own migrations in the app: publish with php artisan vendor:publish --tag=seo-engine-migrations, then set register_migrations => false in config/seo.php (or SEO_ENGINE_REGISTER_MIGRATIONS=false in .env) so Laravel does not load the same files twice.


Configuration (config/seo.php)

Merged config key: seo.

Key Purpose
register_migrations Load package migrations via loadMigrationsFrom() (default true). Set false after publishing migrations into the app. Env: SEO_ENGINE_REGISTER_MIGRATIONS.
defaults.title Fallback page title (default: APP_NAME).
defaults.description Fallback meta description (plain text; used when the model has no description).
defaults.og_type Default Open Graph type (default: website).
defaults.twitter_card Default Twitter card (default: summary_large_image).
defaults.is_index / defaults.is_follow Default robots-friendly flags when generating a new row.
fallback_canonical_url Global fallback when the model provides no canonical via $seoCanonicalUrlAttribute. Request URL discovery is not used. Defaults to APP_URL.
pages Per-slug defaults for static routes (title, description, image, robots, OG/Twitter overrides). Never auto-discovered — you define keys explicitly.
static_page_model_type Value stored in seo_meta.model_type for static pages (default static_page). Env: SEO_STATIC_PAGE_MODEL_TYPE.

After publishing, adjust defaults.* for your product instead of hard-coding strings in controllers.

Static pages: seo:sync

Loops config('seo.pages') and firstOrCreates rows with model_type = static_page_model_type and model_id = page key. Does not overwrite existing rows (safe for production after editors change SEO).

Helper seoPage(string $key) returns the SeoMeta model for one static key. SeoService::forStaticPage(string $key) returns the same array shape as for($model), preferring the DB row when present and otherwise building a virtual row from config only.


Database

Table: seo_meta

Column Notes
id Big integer primary key (standard Laravel).
model_type, model_id Polymorphic owner (string model_id, e.g. Eloquent id as string or static slug like home); unique on (model_type, model_id).
title, description, keywords Core meta; description / keywords are text, nullable.
canonical_url Nullable string.
image Nullable text (URL or path, your app decides).
is_index, is_follow Booleans, default true.
og_type, og_title, og_description, og_image Open Graph fields.
twitter_card, twitter_title, twitter_description, twitter_image, author Twitter / attribution fields.
timestamps created_at, updated_at.
deleted_at Nullable timestamp — soft deletes (SoftDeletes on SeoMeta).

The unique index on (model_type, model_id) still applies to soft-deleted rows (same as page_contents in page-builder). On created, Seoable uses withTrashed()->firstOrCreate() so a trashed row does not cause a duplicate-key insert; if a trashed row is found, it is restore()d (values are not overwritten by the package).

Note: model_id is a string column (Eloquent ids stringified or static slugs such as home).


Architecture

Model

Banulakwin\SeoEngine\Models\SeoMeta — fillable SEO columns; uses SoftDeletes (deleted_at); model() is a morphTo relation.

Trait (core feature)

Banulakwin\SeoEngine\Traits\Seoable:

Disable auto-creation on a specific model by declaring:

The package reads this protected property via reflection so your intent stays encapsulated.

Map auto SEO to different columns — on your model, optionally declare any of these protected properties (they are not on the trait, to avoid PHP trait property conflicts):

Property Purpose Package default when omitted / null
$seoTitleAttribute string or list<string> — attribute name(s); first non-empty value becomes the SEO title title, then name, then config('seo.defaults.title')
$seoDescriptionAttribute string or list<string> — HTML is stripped, result limited to 160 characters description, then config default
$seoImageAttribute string or list<string> — first non-empty value (URL or storage path) image
$seoKeywordsAttribute string or list<string> keywords, then null
$seoCanonicalUrlAttribute string or list<string> canonical_url, then null

Eloquent accessors and casts still apply (getAttribute is used). Example:

Service (singleton)

Banulakwin\SeoEngine\Services\SeoService:

Method Behaviour
for(Model $model) If $model->seo exists, returns its values as a stable array; otherwise returns generateDefault($model) (no DB write).
generateDefault(Model $model) Computes title, description, image, keywords, and canonical from the model using optional *`seoAttribute** properties, then config defaults for anything unset and OG/Twitter from config. Does **not** userequest()->url()` for canonical.
attributesForNewRecord(Model $model) Same shape as generateDefault(), used by the trait for the initial insert.

Prefer constructor or method injection of SeoService in application code; the seo() helper and Seo facade are optional conveniences.

Helper

seo(Model $model): array — delegates to SeoService::for(). Loaded via Composer autoload.files.

Facade (optional)


Design rules


Usage in models

Optional opt-out:

Optional column mapping (see Trait section above):


Laravel / Inertia (controller)

Pass a resolved seo prop for @banulakwin/inertia-seo-engine using inertia_seo() / inertia_seo_page() (from inertia_helpers.php). These map SeoService::for() / forStaticPage() into InertiaSeoPayload: image_path, og_image_path, twitter_image_path, canonical_url, OG/Twitter text overrides, robots flags, and config-backed Twitter site/creator.

Static route key (must match config('seo.pages') / Filament static SEO):

Raw SeoService::for() / seo() arrays use image, og_image, etc. Prefer *`inertia_seo** for Inertia so URLs match **InertiaSeoImageResolver`**.


React (Inertia <Head>)

Use InertiaSeoHead from @banulakwin/inertia-seo-engine in a root layout (with shared appUrl / name). It reads usePage().props.seo and applies fallbacks (e.g. OG/Twitter titles default to title when overrides are empty).

If you render <Head> manually, use the same keys as inertia_seo() (image_path, og_image_path, …), not the raw service image / og_image fields.

Add noindex / nofollow when seo.is_index or seo.is_follow is false (your app’s convention—e.g. robots meta or HTTP headers).


Testing


Changelog

See CHANGELOG.md for details.


Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Run composer quality to ensure tests and style pass
  4. Commit and push
  5. Open a pull request

Package layout (reference)


License

MIT


All versions of laravel-seo-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package banulakwin/laravel-seo-engine contains the following files

Loading the files please wait ...