mastergalen/adsense-ads 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mastergalen/adsense-ads

最新稳定版本:v0.2.0

Composer 安装命令:

composer require mastergalen/adsense-ads

包简介

Display Adsense ads easily in Laravel.

README 文档

README

License Latest Stable Version Total Downloads

Package for easily including Adsense Ad units in Laravel 5.

Installation

In your project root run

composer require mastergalen/adsense-ads

Set up config file

Run php artisan config:publish mastergalen/adsense-ads.

Edit the generated config file in /config/ads.php to add your ad units

return [
    'client_id' => 'YOUR_CLIENT_ID', //Your Adsense client ID e.g. ca-pub-9508939161510421
    'ads' => [
        'responsive' => [
            'ad_unit_id' => 12345678901,
            'ad_format' => 'auto'
        ],
        'rectangle' => [
            'ad_unit_id' => 1234567890,
            'ad_style' => 'display:inline-block;width:300px;height:250px',
            'ad_format' => 'auto'
        ]
    ]
];

Register the package with Laravel

Add the provider to the providers array in your config/app.php file:

Mastergalen\AdsenseAds\AdsServiceProvider::class,

Register an alias:

'Ads' => Mastergalen\AdsenseAds\AdsFacade::class,

Usage

To show ads in your blade templates simply use {!! Ads::show('responsive') !!} , for example.

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 3
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-01