PHP code example of sashagm / seo

1. Go to this page and download the library: Download sashagm/seo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sashagm / seo example snippets



APP_NAME="Laravel"
APP_OG_TYPE="website"
APP_OG_LOCALE="ru_RU"
APP_OG_IMAGE="/storage/images.jpg"
APP_KEYWORDS=""
APP_DESC=""
APP_ROBOTS=""
APP_OG_TITLE=""
APP_OG_DESC=""

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>@yield('title')</title>
    @yield('meta')
</head>
<body>
    <div class="container">
        @yield('content')
    </div>
</body>
</html>

@section('meta') @meta('key') @endsection

@meta('key')

@meta('key','custom description')

@meta('key','','custom og description')

@meta('key','custom description','custom og description')

$meta = Meta::find(1);
$robots = $meta->robots;

$meta = Meta::find(1);
$ogTitle = $meta->og_title;

$meta = Meta::find(1);
$ogDescription = $meta->og_description;

$meta = Meta::find(1);
$description = $meta->description;

$meta = Meta::find(1);
$keywords = $meta->keywords;