Download the PHP package leonardcodep/laravel-adsbygoogle without Composer
On this page you can find all versions of the php package leonardcodep/laravel-adsbygoogle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download leonardcodep/laravel-adsbygoogle
More information about leonardcodep/laravel-adsbygoogle
Files in leonardcodep/laravel-adsbygoogle
Package laravel-adsbygoogle
Short Description Display Google Adsense ads in your Laravel.
License MIT
Homepage https://github.com/leonardcodep/laravel-adsbygoogle
Informations about the package laravel-adsbygoogle
Adsense for Laravel 5, 6, 7 y 8
Package to include Google Adsense ads in your Laravel project.
Installation
In your project root run
Set up config file
Run php artisan vendor:publish --provider="Leonardcodep\Adsbygoogle\AdsbygoogleServiceProvider" --tag="config"
.
Run (Optional) php artisan vendor:publish --provider="Leonardcodep\Adsbygoogle\AdsbygoogleServiceProvider" --tag="views"
.
Edit the generated config file in /config/adsbygoogle.php
to add your ad units
Register the package with Laravel
This package is for Laravel 5.5+ so it takes advantage of auto discover, so no manual configuration is needed
Usage
1°- Copy and paste this code into your website's HTML, between the <head> and </head>
tags.
Show directive
2°- (Optional) Copy and paste this code into your website's HTML, between the <head> and </head>
tags.
Show directive
3°- Copy and paste this code into your website's HTML, at the end before closing the and </body>
tag.
Show directive
4°- To show ads in your blade templates simply use {!! Adsbygoogle::show('responsive') !!}
, for example.