定制 c6digital/filament-og-manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

c6digital/filament-og-manager

最新稳定版本:v0.1.2

Composer 安装命令:

composer require c6digital/filament-og-manager

包简介

Manage your site's Open Graph tags inside of Filament.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a global SEO page that lets you manage Open Graph tags, as well as a set of fields to manage Open Graph tags for specific resources.

Installation

You can install the package via Composer:

composer require c6digital/filament-og-manager

Run the installation command for the package:

php artisan og-manager:install

This will publish and execute migrations.

Usage

Register the plugin:

use C6Digital\OgManager\OgManagerPlugin;

$panel
    ->plugin(
        OgManagerPlugin::make()
    );

The global SEO page will be registered with your panel and automatically appear inside of the panel. Use this form to manage your site wide Open Graph tags.

Rendering meta tags

To render meta tags in your Blade templates, use the provided component:

<head>
    <x-og-manager::seo />
</head>

Model-specific tags

This package provides a custom group of fields that you can add to your own resource forms.

use C6Digital\OgManager\Components\SEO;

public function form(Form $form): Form
{
    return $form->schema([
        SEO::make(),
    ]);
}

You'll then need to add the HasOpenGraphMeta trait to your model.

use C6Digital\OgManager\Concerns\HasOpenGraphMeta;

class Post extends Model
{
    use HasOpenGraphMeta;
}

This registers a new openGraphMeta relationship on your model which this field uses.

To render meta tags for a specific model, pass the model through to the Blade component using the for prop.

<head>
    <x-og-manager::seo :for="$post" />
</head>

Changing the URL

This package defaults to using url()->current() when rendering meta tags (og:url, twitter:url). If you want to change URL you can pass it through as a prop to the Blade component.

<x-og-manager::seo :url="route('posts.show', $post)" />

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-01