Download the PHP package watson/active without Composer

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

Active for Laravel

Build Status Total Downloads Latest Stable Version Latest Unstable Version License Buy us a tree

Active is a helper package for Laravel that makes it easy to recognize the current path or route, useful for adding 'active' classes (like those used in the Boostrap framework) and performing other actions only when a certain route is active. It also includes helpers for retrieving the current controller and action names.

Installation

First, simply require the package through Composer.

Using Laravel 5.1? The latest version of the package that will work for you is 2.0.4.

Next, add the service provider in your config/app.php file.

Watson\Active\ActiveServiceProvider::class

If you'd like to use the Facade instead of the helper functions, add it to the aliases array.

'Active' => Watson\Active\Facades\Active::class

Using Active

Helper functions

Active ships with a couple of helper functions which make it easy to use without the facade or creating an instance of your own.

Using active()

You pass an array of routes or paths you want to see are the current page, and if any match this function will return the string active, for Bootstrap. Alternatively, you can pass a custom return string as the second argument.

In the first example, the function will return the string active if the current path is login, starts with users/ or if the name of the current route is posts.create.

Do note that a number of argument types are provided: you can use a path string, you can use a path string with a wildcard (using the *) and you can also use named routes.

You can use this function with your links to give them an active state.

You can also provide certain paths or routes to be exluded when being considered.

Using is_active()

This works much the same as active(), you can pass the paths and routes to it but instead it will return a boolean if the current page matches.

Additional helpers

Two additional functions are provided to get the current controller and action, if your routing is being handled by a controller for a request. These functions will return the lowercase controller/action name, without the method of the request. Here is an example for a request that is routed to `FooController@getBar':

Licence

Active for Laravel is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.


All versions of active with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/config Version ^10.0|^11.0
illuminate/http Version ^10.0|^11.0
illuminate/routing Version ^10.0|^11.0
illuminate/support 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 watson/active contains the following files

Loading the files please wait ....