A collection on custom blade directives that I find useful

0.0.1 2018-06-11 02:12 UTC

This package is auto-updated.

Last update: 2024-06-09 14:45:54 UTC


A small collection of custom blade directives to be used with Laravel.

Tested on Laravel 5.6+


Directive Output Comment
@app <div id="app"></div> Lazy way to get started with Vuejs
@title('My App') <title>My App</title> Set the title of the page
@js('') <script defer src=""></script> link to external js files
@js(asset('js/main.js')) <script defer src="http://myapp.test/js/main.js"></script> Link to internal js files (such as the ones in assets)
@dnsPrefetch('') <link href="" rel="dns-prefetch"> Prefetches dns for faster css loading
@css(',600') <link href=",600" rel="stylesheet" type="text/css" > Links stylesheet (Could be internal, like js example)


  1. Add "@php artisan view:clear" to your "post-dump-autoload" script in your projects composer.json. It should be the last line, right after "@php artisan package:discover".
"post-autoload-dump": [
  "@php artisan package:discover",
  "@php artisan view:clear"
  1. composer require reed-jones/roller-blade

If you would prefer not to add the view:clear command to your composer.json file, you can simply run php artisan view:clear after installing (and updating, and uninstalling).