Download the PHP package dp-websolutions/laravel-flash without Composer

On this page you can find all versions of the php package dp-websolutions/laravel-flash. 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 laravel-flash

Tailwind flash alert messages and validations for your Laravel apps

This composer package offers an easy way to manage and show laravel flash message alert notifications. Works with Tailwindcss (default) and Bootstrap.

It includes default messages for most commonly used actions such as "success", "error" messages, or CRUD operations (stored, updated, deleted).

Multiple messages can be pushed and displayed.

Installation

Install the package:

Theming

The package does not include any css file. Don't forget to include the framework of your choice.

Alert notifications use tailwind by default, but you can use bootstrap if you want. To see how it works, include the value in your .env file.

If you are using tailwind with purgeCss, you may need to publish the views included in the package, so when Laravel compile the views, purgeCss will remove any unused css class.

You can publish and modify the config and view files (seed docs below).

Usage

Inside any place of your app (typically a controller or middleware) call the "flash" helper included with the package:

The package includes most of the common messages for different actions inside most laravel applications:

Once you have flashed a message in session, you will need to display it in your view. Use the component included in the package:

Don't like the new component syntax? It's ok, use the directive included with the package:

JS API

One or multiple messages can be also flashed via a JS API.

Example

Configuration

You can export the config file to change default messages, views and enable some extra features. You can dot it executing:

Now you should have a flash.php file inside the config folder.

After upgrading laravel-flash to a major version, don't forget to include --force at the end of the above command, to force to re-publish the config file.

Customizing views

Views are really easy to use and modify. You can export the included views to adapt to your needs. You may do su executing:

Now you should have views inside resources/views/vendor/flash folder. If you are upgrading the package, don't forget to include --force at the end of the above command, to force to re-publish the vies.

Using default validations view

By default, the package show the validation errors inside the flash::messages view. Validation errors are showed inside an "alert-danger" as an unordered list.

You can disable this behaviour by changing flash.validations.enabled to false in config/flash.php file.

If you wish, you can modify this view to adapt to your needs, executing:

Example

The package doesn't includes Bootstrap or any other styling or frontend assets frameworks, so you need to import the necessary stylesheets.

Tailwind style

Bootstrap styles

Success

Error

Dismissible

Static

Validations

Tips

All alerts dismissible by default

By default, all alerts are dismissible. You can disable this by changing flash.dismissible to false. If you set flash.dismissible false, you still can make dismissible a certain alert by chaining:

Or make a certain alert static by calling:

Why another flash package?

There are great packages to create flash messages:

The main difference with each one is the ability to set a default message for most common actions (a success action, a model stored, a model updated, a model deleted..).

I decided to create this package to suit my own needs, as most of the time I end up working with many controllers with the basic CRUD operations (Cread, Read, Update, Delete) and writing a message for each operation does not seem to me to be the best way to handle the same message for each operation.

Testing


All versions of laravel-flash with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/session 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 dp-websolutions/laravel-flash contains the following files

Loading the files please wait ....