Download the PHP package appstract/laravel-blade-directives without Composer
On this page you can find all versions of the php package appstract/laravel-blade-directives. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download appstract/laravel-blade-directives
More information about appstract/laravel-blade-directives
Files in appstract/laravel-blade-directives
Package laravel-blade-directives
Short Description Handy Blade directives
License MIT
Homepage https://github.com/appstract/laravel-blade-directives
Informations about the package laravel-blade-directives
Laravel Blade Directives
A collection of nice Laravel Blade directives.
Installation
You can install the package via composer:
Usage
@istrue
Only show when $variable
isset and true.
Or when you would like to quickly echo
@isfalse
Same as @istrue
but checks for isset and false.
@isnull
Only show when $variable
is null.
@isnotnull
Same as @isnull
but one shows when $variable
is not null.
@dump and @dd
@mix
Create a HTML element to your Laravel-Mix css or js.
Output:
@style
Create a <style>
element or <link>
element with a css path.
@script
Create a <script>
element with or without a js path.
@inline
Load the contents of a css or js file inline in your view.
@pushonce
Same as @push
but will include content one time only. Useful for repeatable blocks.
First parameter must follow the syntax stack-name:group-name
.
Include pushes with standard @stack
directive:
@routeis
Checks if the current route name is equal to the given parameter. You can use a wildcard like blog.post.*
.
@routeisnot
Checks if the current route name is not equal to the given parameter. You can use a wildcard like blog.post.*
@instanceof
Checks if the first parameter is an instance of the second parameter.
@typeof
Checks if the parameter is of a certain type.
@repeat
Repeat something a specified amount of times.
@fa, @fas, @far, @fal, @fab, @fad, @mdi, @glyph
Quickly output an icon with Font Awesome, Material Design Icons or Glyphicon.
@data
Output data-attributes from an array.
@haserror
Quickly output for classical $errors->has('input_name')
to determine if any error messages exist for a given field.
@count
Output number of entries.
@nl2br
Replaces \n
into <br>
.
@snake, @kebab, @camel
Output formatted string (uses Laravel Helpers).
Testing
Contributing
Contributions are welcome, thanks to y'all :)
About Appstract
Appstract is a small team from The Netherlands. We create (open source) tools for Web Developers and write about related subjects on Medium. You can follow us on Twitter, buy us a beer or support us on Patreon.
License
The MIT License (MIT). Please see License File for more information.