Download the PHP package daikazu/welcome-bar without Composer

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

Add a welcome bar to the top of your website updatable via API

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Optionally, you can publish the views using

Usage

Add this to your layout file (e.g., resources/views/layouts/app.blade.php) after the opening body tag:

or alternatively you can use the blade directive

Schedule the cleanup command to run in your console routes file

`

Data Structure

This package uses a JSON array of “message objects” to display one or more stacked bars at the top of your webpage. The order of the array determines the vertical stacking order: the first element in the array appears at the very top, the second beneath it, and so on.

Field Explanations

message

Type: string

Description: The main text shown on the bar. This is required.

cta

Type: object (optional fields)

label (string): The text on the button.

url (string): The link destination.

target (string): _blank or _self. Defaults to _self if omitted.

If cta.label and cta.url are both provided, a button will appear.

schedule

Type: object

start (string, ISO datetime): When this message first becomes visible.

end (string, ISO datetime): When this message stops being visible.

Messages are only displayed while the current date/time falls between start and end. If you omit these fields, the message is always considered valid.

behavior

Type: object

closable (boolean): Whether to show a close (×) button.

autoHide (boolean): Whether the bar should automatically hide itself after some time.

autoHideDelay (number): The duration in milliseconds (e.g., 5000 = 5 seconds) before the bar hides if autoHide is true.

theme

Type: object

variant (string): Arbitrary descriptor for the style theme (e.g., "prominent", "subtle").

background (string): Hex code for the bar’s background color.

text (string): Hex code for the bar’s text color.

button (object): Further styles for the CTA button.

background (string): Button background color.

text (string): Button text color.

contrastStrategy (string, "auto" or "manual"):

• If "auto", the bar can compute the best contrasting text color based on background.

• If "manual", the text color is taken as-is from text.

How to Update the Data

You can update this JSON array via:

A POST request to your application’s update route (e.g. POST /welcome-bar/update), or

Directly saving a JSON file in the configured temporary storage location (depending on your setup).

How Data is Rendered

Each entry in the array is displayed as a stacked bar at the top of the page, in the order provided. The package checks:

  1. Is now() between schedule.start and schedule.end?

  2. Is the data valid? (e.g., do we have a message?)

If valid, the bar is rendered with the specified colors, CTA button, and behavior rules.

Tip: If you want to hide all existing bars, simply remove (or empty) this JSON array.

API Routes

Fetch Current Bar Data

Endpoint: GET /api/welcome-bar/data

Description: Fetches the current welcome bar data.

Middleware: Uses the middleware specified in welcome-bar.middleware.fetch.

Response:

Update Bar Data

Endpoint: POST /api/welcome-bar/update

Description: Updates the welcome bar data from an external source.

Middleware: Uses the middleware specified in welcome-bar.middleware.update.

Request Body:

Response:

Ping

Endpoint: GET /api/welcome-bar/ping

Description: Pings the site to check if the welcome bar is installed.

Middleware: Uses the middleware specified in welcome-bar.middleware.fetch.

Response:

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 welcome-bar with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.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 daikazu/welcome-bar contains the following files

Loading the files please wait ....