pr4n4vs/seo-optimizer

There is no license information available for the latest version (dev-main) of this package.

A Laravel package for SEO optimization.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/pr4n4vs/seo-optimizer

dev-main 2024-10-18 19:32 UTC

This package is not auto-updated.

Last update: 2026-01-24 23:39:10 UTC


README

SEO Optimizer is a Laravel package designed to enhance SEO by providing easy management of meta tags, sitemaps, and other SEO-related functionalities.

Features

  • Add default SEO meta tags.
  • Customize meta tags (author, description, keywords, etc.).
  • Simple integration into Blade templates.
  • Extendable for more SEO tasks.

Requirements

  • PHP: ^8.1
  • Laravel: ^9.x, ^10.x, ^11.x

Installation

1. Install via Composer

To install the package in your Laravel project, run the following command in your terminal:

composer require pr4n4vs/seo-optimizer:dev-main

2. Publish the Config (Optional)

If you'd like to customize the default settings, publish the config file:

php artisan vendor:publish --tag=seo-optimizer-config

This will create a configuration file located at config/seo-optimizer.php, where you can define default meta tag values and other SEO settings.

3. Autoload the Package

In case the package doesn't autoload automatically, run:

composer dump-autoload

Usage

After installing the package, you can start adding meta tags to your Blade views.

Add Meta Tags in Blade Templates Use the MetaTagManager class to add meta tags in your Blade templates:

@php // Create MetaTagManager instance $metaTagManager = new \Pranav\SeoOptimizer\MetaTagManager();

// Add default meta tags and custom ones
$metaTagManager->addDefaultMeta()->addMeta('author', 'Your Name');

// Render meta tags in HTML
echo $metaTagManager->render();

@endphp This will render basic meta tags like:

Adding Custom Meta Tags You can add more meta tags for descriptions, keywords, etc.:

@php $metaTagManager = new \Pranav\SeoOptimizer\MetaTagManager(); $metaTagManager->addDefaultMeta() ->addMeta('description', 'This is a custom description') ->addMeta('keywords', 'Laravel, SEO, Optimization'); echo $metaTagManager->render(); @endphp

Configuration After publishing the configuration, you can edit it at config/seo-optimizer.php. This file allows you to set:

Default Site Name Default Description Default Keywords And other settings for meta tags.