0 %
Khalid Bin Ahsan
Full Stack Web Developer
image
  • Email
  • developer@khalidbinahsan.com
  • Whatsapp/Call
  • +8801754879302
Skills
PHP
Laravel
Wordpress
html
CSS
Js
Jquery
Bootstrap
Sass
  • Version Control (Git)
  • Photoshop
  • Adobe Illustrator
  • Filmora

Boost Your Website’s Ranking with Top Laravel SEO Libraries and Tools

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp
Share on pinterest
Share on telegram
Share on tumblr
Share on skype
Share on reddit
Share on pocket
Share on print

Laravel SEO libraries are a collection of tools and resources that developers can use to optimize their Laravel applications for search engines. These libraries provide a range of SEO-related functionality, such as generating sitemaps, managing meta tags, and handling redirects. They can help developers ensure that their applications are properly optimized for search engines, which can improve their visibility and attract more traffic.

Laravel SEO libraries are lightweight, flexible, and easy to use, making them a popular choice for developers who want to improve their site’s SEO performance. Whether you’re building a small business website or a large enterprise application, Laravel SEO libraries can help you achieve your SEO goals and drive more traffic to your application.

There are several Laravel SEO libraries that can help you optimize your website for search engines. Here are some of the top Laravel SEO libraries:

 

1. artesaos

To install this package run this Terminal Command

				
					composer require artesaos/seotools
				
			

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your config/app.php

				
					<?php

return [
    // ...
    'providers' => [
        Artesaos\SEOTools\Providers\SEOToolsServiceProvider::class,
        // ...
    ],
    // ...
];
				
			

Then need to setup a short-version aliases for these facades in your config/app.php

				
					<?php

return [
    // ...
    'aliases' => [
        'SEOMeta'       => Artesaos\SEOTools\Facades\SEOMeta::class,
        'OpenGraph'     => Artesaos\SEOTools\Facades\OpenGraph::class,
        'Twitter'       => Artesaos\SEOTools\Facades\TwitterCard::class,
        'JsonLd'        => Artesaos\SEOTools\Facades\JsonLd::class,
    ],
    // ...
];
				
			

After this, run this Terminal Command

				
					php artisan vendor:publish --provider="Artesaos\SEOTools\Providers\SEOToolsServiceProvider"
				
			

Now add the following meta tag into your Master Layout head 

				
					{!! SEOMeta::generate() !!}
{!! OpenGraph::generate() !!}
{!! Twitter::generate() !!}
{!! JsonLd::generate() !!}
				
			

Now need to update your page controller. Into your index function add the following data

				
					<?php

namespace App\Http\Controllers;

use Artesaos\SEOTools\Facades\SEOMeta;
use Artesaos\SEOTools\Facades\OpenGraph;
use Artesaos\SEOTools\Facades\TwitterCard;
use Artesaos\SEOTools\Facades\JsonLd;
// OR with multi
use Artesaos\SEOTools\Facades\JsonLdMulti;

// OR
use Artesaos\SEOTools\Facades\SEOTools;

class CommomController extends Controller
{
    public function index()
    {
        SEOMeta::setTitle('Home');
        SEOMeta::setDescription('This is my page description');
        SEOMeta::setCanonical('https://codecasts.com.br/lesson');

        OpenGraph::setDescription('This is my page description');
        OpenGraph::setTitle('Home');
        OpenGraph::setUrl('http://current.url.com');
        OpenGraph::addProperty('type', 'articles');

        TwitterCard::setTitle('Homepage');
        TwitterCard::setSite('@LuizVinicius73');

        JsonLd::setTitle('Homepage');
        JsonLd::setDescription('This is my page description');
        JsonLd::addImage('https://codecasts.com.br/img/logo.jpg');


    }
				
			

Don’t forget to import this *

There are lot of meta on artesaos  documentation. you can add your desired meta from it. So you should make all meta data dynamic. You get your title, description, image and others all data from your database and insert it dynamically. Finally, your Controller index function might be like this:

				
					function HomeIndex(){
        $HomeSeo = HomeSeoModel::all();
        $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
        $home_link = "http://$_SERVER[HTTP_HOST]";
        $home_title = $HomeSeo[0]['title'];
        $share_title = $HomeSeo[0]['share_title'];
        $description = $HomeSeo[0]['description'];
        $home_keywords = $HomeSeo[0]['keywords'];
        $home_img = $home_link."/".$HomeSeo[0]['page_img'];

        SEOMeta::setTitle($home_title);
        SEOMeta::setDescription($description);
        SEOMeta::setKeywords($home_keywords);
        SEOMeta::setCanonical($actual_link);

        OpenGraph::addImage($home_img);
        OpenGraph::setTitle($share_title);
        OpenGraph::setDescription($description);
        OpenGraph::setUrl($actual_link);
        OpenGraph::addProperty('type', 'articles');

        TwitterCard::setTitle($share_title);


        JsonLd::setTitle($home_title);
        JsonLd::setDescription($description);
        JsonLd::addImage($home_img);
    }
				
			

2. ralphjsmit

seo

Optimizing your website for search engines is crucial if you want to improve your website’s visibility and accessibility. If you are using Laravel, there are several SEO libraries and tools available that can help you achieve this. Whether you want to manage meta tags, generate meta tags automatically, optimize images, or analyze your website’s content, there is a Laravel SEO package that can help you. By using these tools and packages, you can boost your website’s ranking and attract more traffic to your website.

Tags

Have any questions? Contact Me or left your comment below.

2 Comments
  • Faisal Ahmed

    Thanks for sharing this article

    5:32 pm March 31, 2023 Reply
Write a comment

Category

Latest Posts

Stay Connected

About Me

web developer

Khalid Bin Ahsan

Full Stack Web Developer

My expertise spans across a range of technologies and platforms, including HTML, CSS, JavaScript, jQuery, Bootstrap, PHP, Laravel, and WordPress. With this extensive knowledge and hands-on experience, I have helped numerous clients and businesses develop and optimize their web presence to achieve their goals.. Learn More

Recent Comment