承接 yaroslawww/nova-ad-director 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

yaroslawww/nova-ad-director

Composer 安装命令:

composer require yaroslawww/nova-ad-director

包简介

Laravel nova ad manager to display advertise on site.

README 文档

README

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Laravel nova ad manager to display advertise on site.

Nova Package
V1 V1
V4 V2

Installation

You can install the package via composer:

composer require yaroslawww/nova-ad-director

# optional publish configs
php artisan vendor:publish --provider="NovaAdDirector\ServiceProvider" --tag="config"

# publish translations
php artisan vendor:publish --provider="NovaAdDirector\ServiceProvider" --tag="lang"

Usage

  1. Package supports only predefined sizes. That why developer should firstly specify "global" sizes
  2. Inherit or add to nova AdConfiguration Resource
  3. Inherit or add to auth service provider AdConfigurationPolicy
  4. If app uses configuration with "creatable==false" then developer need create new locations manually php artisan nova-ad-director:ad-config:create <key-name> <location-name>
  5. Then configure ads in your system
use NovaAdDirector\Facades\NovaAdDirector;

class FrontpageController extends Controller
{
    public function __invoke()
    {
        NovaAdDirector::prepareAds([
            'header' => NovaAdDirector::fallbackKey('header', 'frontpage'),
            'medium-posts-list' => NovaAdDirector::fallbackKey('medium', 'list', 'frontpage'),
            'footer-v2' => NovaAdDirector::fallbackKey('footer', 'frontpage'),
        ]);

        return view('frontpage');
    }
}

Key fallback search flow

In multiple situation good to have possibility to use same ad for multiple pages but with some specific ad on specific page, etc. Solution is using fallback flow:

Each key can be computed form multiple nested pointers and system will try to find parent key in case of child is empty.

For example site has multiple pages and multiple posts. That why different pages and posts will search keys like these:

  • header:page:frontpage
  • header:page:contact-us
  • header:post:12
  • header:post:654

each this keys will search fallbacks:

  • header:page:frontpage => header:page => header
  • header:page:contact-us => header:page => header
  • header:post:12 => header:post => header
  • header:post:654 => header:post => header

Administrator in admin can specify only header configuration and in any moment add some specific AD item like header:page:contact-us to override ad only for contact us page or header:post to use specific ad only on posts.

Override default fallback separator

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
       \NovaAdDirector\NovaAdDirector::setFallbackKeyConnector('/');
    }
}

Credits

  • Think Studio

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固