{"repo":"dwightwatson/active","free":true,"listed":false,"github":"https://github.com/dwightwatson/active","clone":"git clone https://github.com/dwightwatson/active.git","description":"Laravel helper for recognising the current route, controller and action.","language":"PHP","stars":325,"topics":["laravel","php"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Active for Laravel ================== 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. Y","default_branch":null,"files":null,"tree":[],"storefront":"/r/dwightwatson","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dwightwatson/active/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}