Download the PHP package cssjockey/laravel-directives without Composer
On this page you can find all versions of the php package cssjockey/laravel-directives. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cssjockey/laravel-directives
More information about cssjockey/laravel-directives
Files in cssjockey/laravel-directives
Package laravel-directives
Short Description This package provides a collection of useful laravel blade directives.
License MIT
Homepage https://github.com/cssjockey/laravel-directives
Informations about the package laravel-directives
Laravel Blade Directives
This package provides a collection of useful laravel blade directives.
Installation
You can install the package via composer:
Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
Usage
@modeldata
Fetch any model by ID to display any data from result.
This will fetch the User
with ID 1 and renders the email address.
@arraydata
Renders the value of an array and supports array dot notation.
example with simple array:
example with multi-dimensional array:
This will return JSON string as the values is array.
Supports dot notation.
@code | @code ... @endcode
Renders the content in <pre>
tag.
example of inline code
example with multi-line code block
@dd
Die and dump, renders only if __APP_ENV is set to local__.
example
@ddd
Dump, die and debug, renders only if __APP_ENV is set to local__.
example
@dump
Inline dump, renders only if __APP_ENV is set to local__.
example
@haserror | @haserror ... @endhaserror
Output content for $errors->has('input_name')
to determine if any error message found for the given input field.
@instanceof ... @endinstanceof
Quickly check if first parameter is an instance of second parameter.
@typeof ... @endtypeof
Quickly check if the parameter is a specific type.
@istrue | @istrue ... @endistrue
Display content if variable of condition is true.
@isfalse | @isfalse ... @endisfalse
Display content if variable of condition is false.
@isnull | @isnull ... @endisnull
Display content only if variable is NULL.
@isnotnull | @isnotnull ... @endisnotnull
Display content only if variable is NOT NULL.
@isuser | @isuser ... @endisuser
Display content only if the user is logged in.
@isguest | @isguest ... @endisguest
Display content only if the user is not logged in.
@routeis | @routeis ... @endrouteis
Show content only if current route matches the first parameter.
@routeisnot | @routeisnot ... @endrouteisnot
Show content only if current route does not match the first parameter.
@repeat ... @endrepeat
Repeat any content specified number of times.
@script | @script ... @endscript
Create a script
element or include a javascript file.
@style | @style ... @endstyle
Create a style
element or include a javastyle file.
@tagattributes
Bind attributes to any html tag.
Changelog
Please see the changelog for more information on what has changed recently.
Todo:
- Add more free icons to the package.
- Create an artisan command to optimize all the SVG files.
Contributing
Please see contributing for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
Mohit Aneja All Contributors
License
MIT Please see the license for more information.