在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):appstract/laravel-blade-directives开源软件地址(OpenSource Url):https://github.com/appstract/laravel-blade-directives开源编程语言(OpenSource Language):PHP 99.2%开源软件介绍(OpenSource Introduction):Laravel Blade DirectivesA collection of nice Laravel Blade directives. InstallationYou can install the package via composer: composer require appstract/laravel-blade-directives Usage@istrueOnly show when @istrue($variable)
This will be echoed
@endistrue Or when you would like to quickly echo @istrue($variable, 'This will be echoed') @isfalseSame as @isfalse($variable)
This will be echoed
@endisfalse @isnullOnly show when @isnull($variable)
This will be echoed
@endisnull @isnotnullSame as @isnotnull($variable)
This will be echoed
@endisnotnull @dump and @dd@dump($var)
@dd($var) @mixCreate a HTML element to your Laravel-Mix css or js. @mix('/css/app.css')
@mix('/js/app.js') Output: <link rel="stylesheet" href="{{ mix('/css/app.css') }}">
<script src="{{ mix('/js/app.js') }}"></script> @styleCreate a @style
body { background: black }
@endstyle
@style('/css/app.css') @scriptCreate a @script
alert('hello world')
@endscript
@script('/js/app.js') @inlineLoad the contents of a css or js file inline in your view. @inline('/js/manifest.js') @pushonceSame as First parameter must follow the syntax @pushonce('js:foobar')
<script src="{{ asset('/js/foobar.js') }}"></script>
@endpushonce Include pushes with standard @stack('js') @routeisChecks if the current route name is equal to the given parameter. You can use a wildcard like @routeis('webshop.checkout')
Do something only on the checkout
@endrouteis @routeisnotChecks if the current route name is not equal to the given parameter. You can use a wildcard like @routeisnot('webshop.checkout')
Do something only if this is not the checkout
@endrouteisnot @instanceofChecks if the first parameter is an instance of the second parameter. @instanceof($user, 'App\User')
User is an instance of App\User
@endinstanceof @typeofChecks if the parameter is of a certain type. @typeof($text, 'string')
Text is a string
@endtypeof @repeatRepeat something a specified amount of times. @repeat(3)
Iteration #{{ $iteration }}
@endrepeat @fa, @fas, @far, @fal, @fab, @fad, @mdi, @glyphQuickly output an icon with Font Awesome, Material Design Icons or Glyphicon. @fa('address-book', 'optional-extra-class')
// for Font Awesome 5 (solid, regular, light, brand, duotone):
@fas('address-book', 'optional-extra-class')
@far('address-book', 'optional-extra-class')
@fal('address-book', 'optional-extra-class')
@fab('address-book', 'optional-extra-class')
@fad('address-book', 'optional-extra-class')
// for Material Design Icons
@mdi('account', 'optional-extra-class')
// for Glyphicons
@glyph('glass', 'optional-extra-class') @dataOutput data-attributes from an array. @data(['testing' => 123]) @haserrorQuickly output for classical @haserror('input_name')
This input has an error
@endhaserror Testingcomposer test ContributingContributions are welcome, thanks to y'all :) About AppstractAppstract 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. LicenseThe MIT License (MIT). Please see License File for more information. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论