agenciafmd/laravel-social-meta

Social Meta for those who doesn't know for what it for

dev-master 2022-07-14 13:54 UTC

This package is auto-updated.

Last update: 2024-10-14 19:04:57 UTC


README

Downloads Licença

  • Social Meta for those who doesn't know for what it for

Installation

composer require agenciafmd/laravel-social-meta:dev-master

Publishing fonts and backgrounds on storage/social-meta

php artisan vendor:publish --tag=social-meta:assets

Usage

Inside your master.blade.php (thanks to Blade UI Kit)

<x-social-meta
    title="{{ $__env->yieldContent('title', 'Culture Eats Strategy for Breakfast') }} | {{ config('app.name') }}"
    description="{{ $__env->yieldContent('description') }}"
/>

On their children

@extends('agenciafmd/frontend::master')

@section('title', 'My custom title')
@section('description', 'My custom description')

Output

<title>My custom title | Laravel</title>

<meta name="twitter:card" content="summary_large_image" />

<meta property="og:type" content="website">
<meta property="og:title" content="My custom title | Laravel" />

<meta name="description" content="My custom description">
<meta property="og:description" content="My custom description">

<meta property="og:image" content="http://starternovo.local/storage/open-graph/facebook/my-custom-title-laravel.png" />
<meta property="og:url" content="http://starternovo.local" />
<meta property="og:locale" content="pt_BR" />
<meta property="og:site_name" content="Laravel"/>
<meta name="author" content="AgĂȘncia F&MD">
 

OpenGraph Image

OpenGraph Image

Customize

php artisan vendor:publish --tag=social-meta:config

Debug

Put inside routes/web.php

use Facades\Agenciafmd\SocialMeta\Services\OpenGraphImage;

Route::get('/asdf', function() {
    return OpenGraphImage::render();
});

License

License MIT. Click here for more details.