定制 salamwaddah/laravel-canonical 二次开发

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

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

salamwaddah/laravel-canonical

Composer 安装命令:

composer require salamwaddah/laravel-canonical

包简介

:package_description

README 文档

README

Laravel Canonical is a simple package designed to help you manage canonical URLs in your Laravel applications. This package provides a convenient way to generate canonical URLs based on the current request, allowing you to avoid duplicate content issues and improve SEO.

Installation

composer require salamwaddah/laravel-canonical

Usage

Add to your layout or any blade file where canonical is needed

<link rel="canonical" href="{{ canonical() }}"/>

Configuration

The package comes with a default configuration file that allows you to specify which query parameters should be included in the canonical URL.

The following default configuration will filter out any query parameters in the page URL and only allow the page=1, page=2, page=...

// canonical.php
'allowed_params' => [
    'page',
],

You can customize this configuration to meet your specific requirements. To publish the configuration file, run the following command:

php artisan vendor:publish --tag=laravel-canonical-config

Testing

composer test

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固