Download the PHP package theorythree/laratoaster without Composer

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

LaraToaster

Latest Version on Packagist Build Status Total Downloads

Description

An easy-to-use notification utility for your Laravel projects.

How it Works

LaraToaster uses the Laravel Session class to create a Flash message from your controllers. When a message is detected, it will inject a Buefy Toast object and alert the user of your message.

How to Install

This package requires that you have Vue, Bulma and Buefy installed in your Laravel project.

Step 1: Via Composer

Step 2: Define the service provider and alias in your Laravel project

This package takes advantage of the new auto-discovery feature found in Laravel 5.5+. If you're using that version of Laravel, then you may skip this step and move on to Step 3.

Add LaraToaster Service Provider to config/app.php.

Define the LaraToaster Alias in config/app.php.

Step 3. Publish the plugin config file and the Vue Component file

Publish the configuration file to override the package defaults and install the LaraToaster.vue component.

$ php artisan vendor:publish --tag=laratoaster

This command will generate a config file config/laratoaster.php and it will install the LaraToaster Vue component resources/assets/js/components/LaraToaster.vue.

Step 4. Install Buefy + Bulma

If you haven't already, install Buefy. Doing so will also install Bulma. $ yarn add buefy

Step 5. Register Vue Component

Register the LaraToaster Vue Component in resources/assets/js/app.js.

Step 6. Run your compiler

Don't forget to run your compiler script to update your js files. $ yarn run dev or $ yarn run watch

Usage

LaraToaster can be used in your project whenever you need to notify the user of an event. Most commonly, in your CRUD controllers. LaraToaster uses the Session::flash method to set a Flash message.

  1. Install package
  2. Include Vue.component('laratoaster', require('./components/LaraToaster.vue')); in resources/assets/js/app.js
  3. Include {!! Toaster::toast() !!} in your Blade template
  4. Set the Toaster message in your controller (see example below)

make()

String make( String $type, String $message )

Description

This method can be used in your Blade template in cases when you wish to show an alert message every time the view is loaded. This method does not rely on a Session so it will trigger the alert instantly upon page load.

Important

The method returns a Vue component named <laratoastert>, so you must make sure that you use {!! !!} instead of {{ }} to bracket the method in your Blade template or the returned string will be escaped.

Also, you must put the tag within an instantiated Vue element. In the examples we're using a div with an id of #app.

Parameters

$type

String: The type of message to be displayed. Accepts any class name supported by Buefy (do not include is- in your type name). (Options: success, warning, danger, black,white, dark, light, info)

$message

String: The alert message to be displayed.

Example 1: Instant Toast


toast()

String toast()

Description

LaraToaster can also be used to rely on Session and this is more likely the setup you'll want to have in your projects. There are two parts to the setup. (1) the toast() method call in your Blade templates (which serves as a placeholder for where the <laratoaster> element will be injected into your template) and (2) the use of one of the many method calls in your controllers.

Below, we're using the success() method because we're optimists.

Important

The method returns a Vue component named <laratoastert>, so you must make sure that you use {!! !!} instead of {{ }} to bracket the method in your Blade template or the returned string will be escaped.

Also, you must put the tag within an instantiated Vue element. In the examples we're using a div with an id of #app.

Example 2 - Standard Toaster Setup


success(), warning(), danger()

String [success, warning, danger]( String $message )

Description

These methods can be used in your controller files to set the type of alert message you wish to trigger. In all cases the a Session Flash message will be set with the message you provide.

Important

Do not forget to include {!! Toaster::toast() !!} in your Blade template within an instantiated Vue element.

Parameters

$message

String: The alert message to be displayed.

Example 3: Setting Your Toaster Messages


Change log

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

Contributing

All contributors welcome. If you would like to contribute to this package please feel to submit a pull request, submit an issue, or request a feature.

See our CODE_OF_CONDUCT for more details.

Credits

Contact

Want to get in touch to discuss this package, or another one you'd like us to build? Feel free to reach out to the maintainer of this package by emailing me at @dmerfeld. I'd really like to hear from you. Honest.

License

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


All versions of laratoaster with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.1
php Version ~5.6|~7.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 theorythree/laratoaster contains the following files

Loading the files please wait ....