Download the PHP package midwestern-interactive/blade-directive-helpers without Composer

On this page you can find all versions of the php package midwestern-interactive/blade-directive-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blade-directive-helpers

Blade Helpers

A collection of Blade Directive to speed up tasks that are common in Blade templates

Installation

1) Move the two included php files in to /app/Providers/. 2) In /config/app.php add

3) The above will enable the directives in your Blade templates.

Since Blade tags get compiled into normal PHP inside your template you are REQUIRED to clear your compiled views via a php artisan view:clear call!

Usage

Blade Helper Directives

*A Blade directive is just a shorter syntax to generate markup.

asset

*The @asset directive provides chache busting functionality by appending the Unix timestamp value of the files modified timestamp

The above markup produces...

This effectively eliminates unwanted caching since any time app.css is deployed the files modified timestamp will get updated and consequently change the v= value in the url for the css file.

A CSS example is shown above, but this can be used for ANY local file you wish to have cache busting enabled on

icon

The @icon directive allows you to generate the full syntax for a simple icon (more complex icons i.e. layered, rotating, etc will still need to be written out). Font-awesome is the assumed font library.

In its simplest form you just pass the name of the icon.

You can also pass two additinal parameters. The second parameter is the $provider so an example would be glyphicon. This should be the class that gets added to the element. The third parameter you can use the the tag type (i, span, etc). If you need access to the third tag you are required to pass the second!

A full example of this would be...

Blade If Directives

Blade "If" directives allow you to shorthand an if statment that you'd normally have to write out. These inherently have an else block available

hasPermission

The has permission directive allows you to wrap markup that you only want displayed if a user has a given permission. Can be used in place of the @can directive.

isInRole

Checks that the user is in a given Role

isActive

This is used to see if a link is currently the active link

This directive calls the Request::is(...) function internally so you can pass any string to check that would work there. i.e. @isActive('users*) would match /users as wells /users/manage/1

As with all if directives there is an else block available. i.e. <a href="/users" class="@isActive('users')active @else muted@endisActive>Users</a>


All versions of blade-directive-helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package midwestern-interactive/blade-directive-helpers contains the following files

Loading the files please wait ....