PHPackages                             vormia-folks/atu-rank-seo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vormia-folks/atu-rank-seo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vormia-folks/atu-rank-seo
=========================

ATU Rank SEO - A package for Laravel that provides rank SEO support for your e-commerce website.

v2.0.2(1mo ago)0128MITPHPPHP ^8.2

Since Jan 9Pushed 1mo agoCompare

[ Source](https://github.com/vormia-folks/atu-rank-seo)[ Packagist](https://packagist.org/packages/vormia-folks/atu-rank-seo)[ RSS](/packages/vormia-folks-atu-rank-seo/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (9)Versions (11)Used By (0)

ATU Rank SEO
============

[](#atu-rank-seo)

A companion SEO package for the Vormia ecosystem. ATU Rank SEO provides centralized, snapshot-based SEO management tightly integrated with Vormia's `SlugRegistry`, enabling page-level and media-level SEO similar in spirit to Yoast SEO (WordPress), but designed for Laravel applications.

Current package version: **1.3.1** (`Vormia\ATURankSEO\ATURankSEO::VERSION`).

Features
--------

[](#features)

- **Snapshot-based SEO**: Resolved on save, not runtime
- **Slug-driven**: SEO rows reference Vormia's SlugRegistry; the package does not ship migrations that alter `vrm_slug_registry` (snapshot generation may still `firstOrCreate` a slug row — see developer guide)
- **Page &amp; Media SEO**: Support for both page-level and media-level SEO
- **Cache-first**: Optimized for performance with cache-first resolution
- **UI-driven Management**: Admin panel for managing SEO entries
- **Placeholder Support**: Dynamic placeholder resolution (e.g., `{make}`, `{model}`, `{year}`)
- **Global SEO Settings**: Centralized default SEO values

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require vormia-folks/atu-rank-seo
```

### Run Installation Command

[](#run-installation-command)

```
php artisan aturankseo:install
```

This will:

- Optionally add environment variables to `.env` and `.env.example` (unless `--skip-env`)
- **By default**, copy admin Livewire Blade files from the package (`src/stubs/resources/views/livewire/admin/atu/rank-seo/`, Multicurrency-style) into your app’s `resources/views/livewire/admin/atu/rank-seo/`, append a marked Livewire route group to `routes/web.php`, then set `ATU_RANKSEO_ADMIN_ENABLED=false` so the host owns admin URLs (the package stops registering the same routes). Use `--skip-host-copy` to keep routes and views package-only (previous “package-first” behavior). Use `--force` to overwrite existing copied Blade files.
- Optionally run `php artisan migrate` (interactive confirmation; default **yes**)
- Optionally run the package seeder (only after migrations succeed; interactive confirmation; default **yes** — you can answer **no** to skip seeding)

Migrations always load from the package via `loadMigrationsFrom` (they are not copied). When host views exist under your app’s `resources/views/livewire/admin/atu/`, `ATURankSEOServiceProvider` registers that path with `Livewire::addLocation` **before** the package stubs path so your copies override vendor. Optional config publish:

```
php artisan vendor:publish --tag=aturankseo-config
```

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

Typical keys (see `config/atu-rank-seo.php` after publishing):

```
ATU_RANKSEO_ENABLED=true
ATU_RANKSEO_CACHE_TTL=3600
ATU_RANKSEO_ADMIN_ENABLED=true
```

When `ATU_RANKSEO_ADMIN_ENABLED` is `false`, the package does not register admin Livewire routes (the default after `aturankseo:install`, because routes are appended to your `routes/web.php`). Set it to `true` only if you removed the host route block and want the package to register admin URLs again.

### Config File

[](#config-file)

Publish to `config/atu-rank-seo.php` with the tag above. You can customize:

- Global `enabled` and admin `enabled`, `middleware`, `prefix`
- Cache TTL and prefix
- `default_variables` — suggested defaults only (not wired into `SeoSnapshotService` placeholder resolution; use `dynamic_variables` in settings or pass values in `$data`)
- `media_directory` / `media_types` — documented intent for media handling; `MediaIndexerService::scanAndRegister()` currently scans **`public/media`** (see source if this changes)

Usage
-----

[](#usage)

### Resolving SEO for a Page

[](#resolving-seo-for-a-page)

```
use Vormia\ATURankSEO\Services\SeoResolverService;

$seoResolver = app(SeoResolverService::class);
$seo = $seoResolver->forSlug('my-page-slug');

// Returns:
// [
//     'title' => 'Page Title',
//     'description' => 'Meta description',
//     'keywords' => 'keyword1, keyword2',
//     'canonical_url' => 'https://example.com/page',
//     'robots' => 'index, follow',
// ]
```

### Generating SEO Snapshot

[](#generating-seo-snapshot)

```
use Vormia\ATURankSEO\Services\SeoSnapshotService;

$snapshotService = app(SeoSnapshotService::class);
$snapshotService->generateForSlug('my-page-slug', [
    'title' => 'Buy {make} {model} {year}',
    'description' => 'Find the best {make} {model} deals',
    'make' => 'Toyota',
    'model' => 'Camry',
    'year' => '2024',
]);

// Placeholders are resolved and stored in database
```

### Media SEO

[](#media-seo)

```
use Vormia\ATURankSEO\Services\MediaIndexerService;

$mediaIndexer = app(MediaIndexerService::class);

// Scan public/media recursively and register new files (paths relative to public/, e.g. media/photo.jpg)
$mediaIndexer->scanAndRegister();

// Register a single media file
$mediaIndexer->registerMedia('media/images/product.jpg', [
    'title' => 'Product Image',
    'alt_text' => 'Product photo',
    'caption' => 'High-quality product image',
]);
```

Admin Panel (Livewire 4)
------------------------

[](#admin-panel-livewire-4)

The admin UI uses **Livewire 4 single-file components** (inline `new class extends Component` in each Blade file), aligned with the Multicurrency package. Shipped views live only under **`src/stubs/resources/views/livewire/admin/atu/rank-seo/`** in this repository (there is no duplicate `resources/views/` tree at the package root). After `aturankseo:install` (default), those files are copied into your app; `ATURankSEOServiceProvider` registers `Livewire::addLocation` for your app’s `resources/views/livewire/admin/atu` directory first when it exists, then the package stubs tree, and routes are typically registered from your `routes/web.php` with `ATU_RANKSEO_ADMIN_ENABLED=false`.

ScreenLivewire component nameBlade path (in package)SEO entries list`rank-seo.index``src/stubs/resources/views/livewire/admin/atu/rank-seo/index.blade.php`Global settings`rank-seo.settings``.../settings.blade.php`Edit page SEO`rank-seo.edit``.../edit.blade.php`Media list`rank-seo.media-index``.../media-index.blade.php`Edit media SEO`rank-seo.media-edit``.../media-edit.blade.php`Toasts use the in-package concern `Vormia\ATURankSEO\Livewire\Concerns\WithRankSeoToasts` (not application-level notification traits).

### Routes (default)

[](#routes-default)

After **`php artisan aturankseo:install`** (without `--skip-host-copy`), a marked Livewire route group is appended to `routes/web.php` and `ATU_RANKSEO_ADMIN_ENABLED` is set to `false`, so the **host** registers the admin URLs. When `atu-rank-seo.enabled` is true and `atu-rank-seo.admin.enabled` is true **and** the package is allowed to register routes (`ATU_RANKSEO_ADMIN_ENABLED` true, for example after `aturankseo:install --skip-host-copy`), `ATURankSEOServiceProvider` registers the same endpoints (default prefix `admin/atu`, names `admin.atu.rank-seo.*`) using `Route::livewire($uri, $componentName)`.

### Manual routes (optional)

[](#manual-routes-optional)

If you disable package route registration (`ATU_RANKSEO_ADMIN_ENABLED=false` or `admin.enabled` false) and you do not rely on the install-generated `web.php` block, register the same endpoints yourself. The installer writes a block delimited by `// >>> ATU Rank SEO start` … `// > ATU Rank SEO Web Routes START` … `// > ATU Rank SEO Sidebar START --}}
@if (auth()->user()?->isAdminOrSuperAdmin())

	{{-- SEO Entries --}}

		{{ __('SEO Entries') }}

	{{-- Media SEO --}}

		{{ __('Media SEO') }}

	{{-- SEO Settings --}}

		{{ __('SEO Settings') }}

@endif
{{-- isAdminOrSuperAdmin())` pattern as Section 1 (see the comment above Section 2 in the stub).
3. Ensure admin routes are registered (see [Routes (default)](#routes-default) / [Manual routes (optional)](#manual-routes-optional)) so `route('admin.atu.rank-seo.*')` resolves.
4. On uninstall, remove the pasted block (search for `ATU Rank SEO Sidebar` or the route names if you kept the markers).

Commands
--------

[](#commands)

- `php artisan aturankseo:install` — Env keys, copy admin views + append `routes/web.php` by default (`--skip-host-copy`, `--skip-env`, `--force`)
- `php artisan aturankseo:update` — Re-apply env keys
- `php artisan aturankseo:uninstall` — Optional env removal, optional host `web.php` + copied views cleanup, optional migration rollback, cache clears (`--keep-env`, `--keep-host-files`, `--force`)
- `php artisan aturankseo:help` — Show env keys and route summary

Uninstallation
--------------

[](#uninstallation)

```
php artisan aturankseo:uninstall
```

### What the uninstall command does

[](#what-the-uninstall-command-does)

1. Optionally removes the ATU Rank SEO block from `routes/web.php` (install markers `// >>> ATU Rank SEO start` … `// > ATU Rank SEO Web Routes START` … `//
