Download the PHP package sven/helpers without Composer
On this page you can find all versions of the php package sven/helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package helpers
Short Description A collection of useful helper functions for in Laravel applications.
License MIT
Informations about the package helpers
Helpers
This is a collection of useful helpers for use in Laravel applications. Mainly made for personal use, but if you find (some of) the helpers useful, feel free to use it!
Installation
Via composer:
Or add the package to your dependencies in composer.json
and run
composer install
on the command line to download the package:
Available functions
All available functions are listed here, along with their usage and an example on how I would use them.
active_route
This function will return true
if you're on the given route name, false
otherwise:
You may also pass in optional $positive
or $negative
values to return:
There is also an option to give it an array of multiple route names instead of just one. The function will
return $positive
if the current route matches any of the given ones, $negative
otherwise:
active_route()
can be tremendously useful for active
states on for instance navigation in blade templates:
str_possessive
This function will return the possessive form of a subject string you give it:
It will only append an apostrophe (without the trailing s
) if the given subject ends
in s
, z
or ch
:
pipe
The pipe()
function will simply return an instance of the \Illuminate\Pipeline\Pipeline
class from Laravel's container, which allows for some neat chaining:
Contributing
All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the CONTRIBUTING.md first, though. See the contributors page for all contributors.
License
sven/helpers
is licensed under the MIT License (MIT). Please see the
license file for more information.