Download the PHP package usamamuneerchaudhary/adment without Composer

On this page you can find all versions of the php package usamamuneerchaudhary/adment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package adment

Adment - Filament Ad Manager

Latest Version on Packagist Scrutinizer Code Quality CodeFactor Build Status Code Intelligence Status Total Downloads Licence

A simple custom ad & Google AdSense manager for Filament v5 on Laravel 12/13 — placements, responsive (and GIF/video) creatives, weighted A/B rotation, scheduling windows, geo/device targeting, impression & CTR analytics, obfuscated click tracking, AdSense Auto Ads & ad units, ads.txt management, and an optional public JSON API.

Requires: PHP 8.3+, Laravel 12 or 13, Filament 5 (Livewire 4).


Features

Installation

Register the plugin in your panel provider:

Registering locations

In config/adment.php:

Or at runtime (e.g. in a service provider or theme boot):

Displaying ads

Blade components (recommended):

Facade / service:

Ads are loaded once per request and memoized; Ads::load(force: true) refreshes.

For impression beacons to work on public pages, include a CSRF meta tag in your layout:

Weighted rotation & scheduling

AdSense units ignore schedule dates and never expire.

Geo & device targeting

On each custom ad you can set:

Country is resolved from request headers, in order:

  1. Configured adment.targeting.country_resolver callable (if set)
  2. CF-IPCountry
  3. CloudFront-Viewer-Country
  4. X-Country-Code

When an ad has country targeting and the country cannot be resolved, the ad is excluded by default (unknown_country_behavior = exclude_restricted).

Media types

Custom ads support:

Media type Rendered as
Image Responsive <picture> (desktop / tablet / mobile)
GIF <img> with srcset fallbacks
Video <video autoplay muted loop playsinline> (mp4 / webm)

Upload accepted types are enforced in Filament based on the selected media type.

Impression tracking & CTR

Custom creatives wrap in a beacon container. When ~50% of the ad is visible, a one-shot POST to /ai-{sha1}/{key} records an impression (lifetime impressions + today's ad_daily_stats row) and dispatches AdImpressionRecorded.

CTR is clicks / impressions × 100. Open Ad analytics in the Marketing nav group for:

AdSense

Configure in Ads settings in the panel (mode: Disabled / Auto Ads / Ad units), then add to your public layout:

Click tracking

Custom ads with a destination URL render links through /ac-{sha1(key.id)}/{key}. The handler verifies the hash (hash_equals), refuses non-HTTP(S) destinations, increments clicked and today's daily click stat without model events or timestamp bumps, dispatches AdClicked, and redirects. A legacy /ads-click/{key} route is included.

Public API (optional)

Enable in config ('api' => ['enabled' => true]):

Returns published, in-window ads ordered by weight, with tracked link URLs; the raw destination is never exposed.

Extending

Architecture

Design decisions:

Testing

The suite covers the model (key generation, hash, image fallbacks, scopes, schedule/CTR, click & impression counting), the manager (filtering, weighted selection, targeting, attribute passthrough, AdSense rendering, URL non-leakage), click & impression routes (hash tampering, unsafe URLs, legacy route, daily stats), Blade components (image / GIF / video), targeting & weighted selector units, the public API, the AdSense snippet validator, and the Filament resource + settings page via Livewire.

Screenshots

License

MIT


All versions of adment with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
filament/filament Version ^5.0
illuminate/contracts Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.92
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package usamamuneerchaudhary/adment contains the following files

Loading the files please wait ...