PHP code example of midwestern-interactive / blade-directive-helpers
1. Go to this page and download the library: Download midwestern-interactive/blade-directive-helpers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
midwestern-interactive / blade-directive-helpers example snippets
/**
* Custom Service Providers
*/
App\Providers\BladeDirectiveProvider::class,
App\Providers\BladeIfDirectiveProvider::class,
<link href="@asset('/css/app.css')" rel="stylesheet">
<a href="#/">@icon('envelope')Messages</a>
<!-- Produces -->
<!-- <a href="#"><i class="fa fa-envelope"></i></a> -->
@hasPermission('manage-users')
<li><a href="...">Manage Users</a></li>
@else
<!-- Alternate link if they can't manage users -->
@endhasPermission
...
...
@isInRole('admin')
<li><a href="...">Manage Users</a></li>
@else
<!-- Alternate link if they can't manage users -->
@endisInRole
...
<a href="#" @isActive('/')class="active"@endisActive>Home</a>