agenciafmd / laravel-social-meta
Social Meta for those who doesn't know for what it for
Installs: 3 269
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- laravel/framework: 8.*
This package is auto-updated.
Last update: 2024-12-14 19:22:56 UTC
README
- 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
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.