PHPackages                             juzaweb/ads-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. juzaweb/ads-manager

ActiveJuzaweb-module

juzaweb/ads-manager
===================

Juzaweb CMS Admin

2.0.2(2mo ago)42.8k↓50%1MITPHPPHP ^8.2CI passing

Since Apr 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/juzaweb/ads-manager)[ Packagist](https://packagist.org/packages/juzaweb/ads-manager)[ Docs](https://juzaweb.com)[ RSS](/packages/juzaweb-ads-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (15)Used By (1)

Ads Manager Module
==================

[](#ads-manager-module)

This advertising management module for Juzaweb CMS supports both banner and video ads, with flexible display placement management capabilities.

Features
--------

[](#features)

- **Banner Ads Management**: Manage banner advertisements with two types:
    - Image Banner: Display images with clickable links
    - HTML Banner: Custom HTML code support
- **Video Ads Management**: Manage video advertisements with VAST support
- **Position Management**: Manage ad positions by theme
- **Statistics Tracking**: Track views and clicks
- **Frontend Integration**: Helper functions for displaying ads on frontend

Installation
------------

[](#installation)

This module is part of Juzaweb CMS. To install:

```
composer require juzaweb/ads-manager
```

Usage
-----

[](#usage)

### Registering Ad Positions

[](#registering-ad-positions)

Register ad positions in your theme or module:

```
use Juzaweb\Modules\AdsManagement\Facades\Ads;

// Register banner position
Ads::position('header-banner', function () {
    return [
        'name' => 'Header Banner',
        'type' => 'banner',
    ];
});

// Register video position
Ads::position('video-preroll', function () {
    return [
        'name' => 'Video Pre-roll',
        'type' => 'video',
    ];
});
```

### Displaying Ads in Frontend

[](#displaying-ads-in-frontend)

#### Using Helper Function

[](#using-helper-function)

```
// In Blade template
{!! ads_position('header-banner') !!}
```

#### Using Facade

[](#using-facade)

```
use Juzaweb\Modules\AdsManagement\Facades\Ads;

$banner = Ads::getBanner('header-banner');
if ($banner) {
    echo $banner->getBody();
}
```

### Managing Ads Programmatically

[](#managing-ads-programmatically)

#### Create Banner Ad

[](#create-banner-ad)

```
use Juzaweb\Modules\AdsManagement\Models\BannerAds;
use Juzaweb\Modules\AdsManagement\Enums\BannerAdsType;

$banner = BannerAds::create([
    'name' => 'Homepage Banner',
    'body' => 'uploads/banner.jpg', // For image type
    'url' => 'https://example.com',
    'type' => BannerAdsType::TYPE_BANNER,
    'active' => true,
]);

// Assign to position
$banner->positions()->create([
    'position' => 'header-banner',
    'theme' => 'default',
]);
```

#### Create Video Ad

[](#create-video-ad)

```
use Juzaweb\Modules\AdsManagement\Models\VideoAds;

$videoAd = VideoAds::create([
    'name' => 'Pre-roll Ad',
    'title' => 'Watch this ad',
    'url' => 'https://example.com',
    'video' => 'https://example.com/ad-video.mp4',
    'position' => 'pre-roll',
    'offset' => 0,
    'active' => true,
]);
```

### Querying Ads

[](#querying-ads)

```
use Juzaweb\Modules\AdsManagement\Models\BannerAds;

// Get active banners for specific position
$banners = BannerAds::whereFrontend()
    ->wherePosition('header-banner')
    ->get();

// Get all banner positions
$positions = Ads::bannerPositions();

// Get all video positions
$positions = Ads::videoPositions();
```

Admin Panel
-----------

[](#admin-panel)

The module automatically registers menus in the admin panel:

- **Ad Management** (parent menu)
    - **Banner Ads**: Manage banner advertisements
    - **Video Ads**: Manage video advertisements

### Permissions

[](#permissions)

- `banner-ads.index`: View banner ads list
- `video-ads.index`: View video ads list

API Endpoints
-------------

[](#api-endpoints)

### Admin Routes

[](#admin-routes)

- `GET /admin-cp/banner-ads` - List banner ads
- `GET /admin-cp/banner-ads/create` - Create banner ad form
- `POST /admin-cp/banner-ads` - Store new banner ad
- `GET /admin-cp/banner-ads/{id}/edit` - Edit banner ad form
- `PUT /admin-cp/banner-ads/{id}` - Update banner ad
- `DELETE /admin-cp/banner-ads/{id}` - Delete banner ad

Similar routes for video ads at `/admin-cp/video-ads`

VAST Support
------------

[](#vast-support)

The module supports VAST (Video Ad Serving Template) for serving video ads:

- `Juzaweb\Modules\AdsManagement\Vast\Document` - VAST document builder
- `Juzaweb\Modules\AdsManagement\Vast\Factory` - Factory for creating VAST elements
- Support for InLine and Wrapper ads
- Linear and Non-linear creatives

Configuration
-------------

[](#configuration)

Publish config file:

```
php artisan vendor:publish --tag=ad-management-config
```

Config file location: `config/ad-management.php`

Translations
------------

[](#translations)

The module supports multiple languages including:

- English (en)
- Vietnamese (vi)
- Spanish (es)
- French (fr)
- German (de)
- Czech (cs)
- Portuguese (pt)
- Russian (ru)

Development
-----------

[](#development)

### Running Tests

[](#running-tests)

```
composer test
```

### Code Style

[](#code-style)

The module follows PSR-2 coding standards.

License
-------

[](#license)

MIT License

Author
------

[](#author)

The Anh Dang - [Juzaweb CMS](https://juzaweb.com)

Support
-------

[](#support)

For issues and feature requests, please use the [GitHub issue tracker](https://github.com/juzaweb/cms).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 91.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~109 days

Recently: every ~174 days

Total

14

Last Release

66d ago

Major Versions

1.1.6 → 2.0.02026-02-11

1.1.7 → 2.0.12026-03-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/3169e8a8781068840e9300a57785089da521287dbe0279fc9cc7e8de1c1d95a9?d=identicon)[juzaweb](/maintainers/juzaweb)

---

Top Contributors

[![juzaweb](https://avatars.githubusercontent.com/u/47020363?v=4)](https://github.com/juzaweb "juzaweb (72 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (7 commits)")

---

Tags

adsbannercmslaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juzaweb-ads-manager/health.svg)

```
[![Health](https://phpackages.com/badges/juzaweb-ads-manager/health.svg)](https://phpackages.com/packages/juzaweb-ads-manager)
```

###  Alternatives

[juzaweb/cms

Juzaweb CMS is a Content Management System (CMS) developed based on Laravel Framework and web platform whose sole purpose is to make your development workflow simple again. Project develop by Juzaweb

187571.2k](/packages/juzaweb-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
