Download the PHP package kenepa/banner without Composer

On this page you can find all versions of the php package kenepa/banner. 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 banner

Banner

Latest Version on Packagist Total Downloads

Introduction

Filament Banner is a powerful Filament plugin that allows you to seamlessly integrate dynamic banners into your Filament-based application. With this plugin, you can easily create, manage, and display engaging banners that can be customized to your specific needs.

Demo:

Create banner

Create scoped banner

A scoped banner is only visible on the selected resource pages.

Features

Getting started

Before we get started, it's important to know that banners can be stored in 2 ways: cache and database.

By default, the plugin stores the banner in the cache. If you want to persist the banners in the database, you'll need to follow the additional instructions.

Cache only

The cache option provides a quick and easy way to get started. It's suitable for displaying occasional or temporary banners, as it's faster to get started because doesn't require additional setup. However, banners stored in the cache will be lost if the cache is cleared.

Database

The database option is for users who need to use banners more extensively or require persistent storage. Storing banners in the database ensures they don't get lost, allows for better management, and offers more scalability as your application grows. By providing both options, the plugin gives you the flexibility to choose the storage method that best fits your application's requirements.

Installation

  1. Install the package via composer:

  2. Setup custom theme

    Filament v3 recommends that you create a custom theme to better support a plugin's additional Tailwind classes. After creating your custom theme, you should add the views of the banner plugin the to your new theme's tailwind.config.js file, which is typically located at resources/css/filament/admin/tailwind.config.js:

    Import Banner's custom stylesheet into your theme's CSS file located at resources/css/filament/admin/theme.css. (Be aware this may differ in your project):

    Compile your theme:

    Run the filament upgrade command:

  3. Add plugin to your panel

Persists banners in database (optional)

If you want to use the database storage option, you can follow these steps:

Note: Your database must support JSON column type

  1. Publish & run migrations You can publish and run the migrations with:

  2. Configure the plugin

    Add the persistsBannersInDatabase() the banner plugin.

Usage

Using the UI to create banners

This package provides a comprehensive banner management system, allowing you to create, view, update, and delete banners to be displayed throughout your application.

Programmatically create banners

If you want to programmatically create banners, you can use the BannerManager facade. The BannerManager uses a Banner Value Object. Because this package allows you to choose how you want to store the banner, I wanted a single way to represent a banner when interacting with the BannerManager. Looking for more information about what Value Objects are and why they could be useful, I recommend this article.

Note: Functionality for the BannerManager is limited at the time because this is all that I needed for the project. But feel free to make PRs to extend its functionality.

You'll need to create a Value Object first to represent the banner.

You'll need generate the id of the banner your self. Tip use uniqid()

Create

Now you can create the Banner using the bannerData object.

Get All

Delete

Update

Configuring the Banner Plugin

The BannerPlugin class provided by the package allows you to customize various aspects of the banner management system. This includes the plugin's title, subheading, navigation settings, and more.

To customize the plugin, you can use the static BannerPlugin::make() method and chain the various configuration methods together.

Title and Subheading

You can set the title and subheading of the banner manager page using the title() and subheading() methods, respectively.

Navigation Settings

The plugin also allows you to customize the navigation settings, such as the icon, label, group, and sort order.

Disable Banner manager You can disable the banner manager altogether. For example, if you want to disable the banner manager for a different panel without having to set permissions for that page.

Authorization

Step 1.

By default, the banner manager is available for everyone. To restrict access, you'll need to add the ability (also known as "permission" within the context of the Spatie Permission package) as shown below:

Step 2.

Example using Laravel gates Inside the boot() method of your service provider define a gate with the same name you have configured for the plugin.

Example using spatie permission package This example shows how to create a permission and assign it a users

After the correct ability/permissions have been created and assigned, the banner manager will only be available to a select group of users.

Optional

Publishing views

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of banner with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^3.0
spatie/laravel-package-tools Version ^1.15.0
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 kenepa/banner contains the following files

Loading the files please wait ....