New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mastergalen/adsense-ads

Display Adsense ads easily in Laravel.
11,253 11
Install
composer require mastergalen/adsense-ads
Latest Version:v0.2.0
PHP:>=7.4.0
Laravel:8 · 9
Older releases:5
License:MIT
Last Updated:Apr 30, 2023
Links: GitHub  ·  Packagist
Maintainer: Mastergalen

Adsense Ads for Laravel 5

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.

Related Packages

martinbutt/laravel-adsense

Display Adsense ads easily in Laravel 6.x, 7.x and 8.x

1,077 10
usamamuneerchaudhary/adment

Production-grade ad & Google AdSense manager for Filament v5, placements, respon...

527 10
spotonlive/laravel-facebook-ads

Facebook integration for Laravel

17,057 19
ardyn/adsense

A convenient way to include Google AdSense ads within your pages.

1,676 4
edujugon/laravel-google-ads

Google Adwords API for Laravel

425,821 64

Version History

Version Released PHP Laravel License
v0.2.0 >=7.4.0 ^8.42|^9.0 MIT
v0.1.5 >=5.4.0 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*| 5.5.* MIT
v0.1.4 >=5.4.0 5.0.*|5.1.*|5.2.*|5.3.*|5.4.* MIT
v0.1.3 >=5.4.0 5.0.*|5.1.*|5.2.*|5.3.* MIT
v0.1.2 >=5.4.0 5.0.*|5.1.*|5.2.* MIT