Download the PHP package valkovic/flash without Composer

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

Flash Messages for Your Laravel App

This package is inspired by laracast/flash package.
Unlike that package, this package allows to use multiple flash messages during one request and set additional properties to HTML tag.

Installation

First, pull in the package through Composer.

Run composer require valkovic/flash

And then, if using Laravel 5, include the service provider within config/app.php.

For correct use, you must also register middleware, that cares about loading and saving flash messages during requests. Attach middleware to any group you want, for example I will attach it to web group. Settings are at file app/Http/Kernel.php.

You can also register Facade for Flash package. Just set alias in config/app.php

Usage

Within your controllers, before you perform a redirect...

You may also do:

Behind the scenes, this will set valkovic.flash-messages key in the session:

During next request, Valkovic\Flash\FlashMiddleware will load messages from session and share them to all views as Flashes variable.
Then, in your view, you can iterate over them.

If you set type of message, that type is attach to message as CSS class. If you want to render also that class, you must call $flash->renderProperties(). Because this text contains HTML specific tag, you must not escape output from that method.

Note that type of messages reflect classes in Twitter Bootstrap.

If you with, you can add more classes or even properties to tag. For example, this code

with previous blade example will produce following code.

Another usage

This package provides Flash model, Flash facade and also flash helper function. You are free yo choose, which approach more suits for you. If you want to use Flash facade, you will first need to register alias for it, as is noted in Install section.

These commands will have same results.

If you don't want to use Bootstrap specific classes, you are free to use array of properties as second parameter to message method or flash helper.

Hiding Flash Messages

A common desire is to display a flash message for a few seconds, and then hide it. To handle this, write a simple bit of JavaScript. For example, using jQuery, you might add the following snippet just before the closing </body> tag. Because you can attach id property to tag, you can refer to id property directly.

Custom views

This package in current version don't provide views, to show flash messages.


All versions of flash with dependencies

PHP Build Version
Package Version
Requires illuminate/session Version ^5.4
illuminate/support Version ^5.4
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 valkovic/flash contains the following files

Loading the files please wait ....