Download the PHP package ryangjchandler/laravel-helpers without Composer
On this page you can find all versions of the php package ryangjchandler/laravel-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ryangjchandler/laravel-helpers
More information about ryangjchandler/laravel-helpers
Files in ryangjchandler/laravel-helpers
Package laravel-helpers
Short Description A collection of helper functions that I use across my projects.
License MIT
Homepage https://github.com/ryangjchandler/laravel-helpers
Informations about the package laravel-helpers
A collection of helper functions that I use across my projects.
This package includes some of the helper functions that I tend to use in all of my projects.
Installation
You can install the package via composer:
Usage
user
Returns the current user, or null depending on authentication status.
This function assumes that your
User
model is found inside ofapp/Models
and will not be registered if that class doesn't exist.
route_is
Check if the current route name matches the provided string.
authorize
Identical to Laravel's $this->authorize()
method provided by the AuthorizesRequests
trait.
attributes()
and @attributes
Laravel 9 introduces new directives for checked, disabled and selected. In some cases though, you might want to output a variety of different attributes using PHP values.
attributes()
and the @attributes()
directive can help with that:
mdash()
It's quite common to output an —
in your HTML code when it isn't present. Doing this with regular Blade {{ }}
tags can be annoying though since —
needs to be output in "raw" mode.
This function uses HtmlString
to return a "safe" wrapper around the HTML entity which allows it to be output without being escaped.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ryan Chandler
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-helpers with dependencies
spatie/laravel-package-tools Version ^1.4.3
illuminate/contracts Version ^11.0