-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add blade snippets * fix json formatting
- Loading branch information
Showing
5 changed files
with
631 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"Blade-component": { | ||
"prefix": "Blade::component", | ||
"body": "Blade::component('${1:package-name}', ${2:PackageNameComponent}::class);", | ||
"description": "Registering Package Components (AppServiceProvider boot method)" | ||
}, | ||
"Blade-include": { | ||
"prefix": "Blade::include", | ||
"body": "Blade::include('${1:includes.input}', '${2:input}');", | ||
"description": "Aliasing Includes (AppServiceProvider boot method)" | ||
}, | ||
"Blade-if": { | ||
"prefix": "Blade::if", | ||
"body": [ | ||
"Blade::if('${1:env}', function ($${2:environment}) {", | ||
" ${3:return app()->environment($$environment);}", | ||
"});" | ||
], | ||
"description": "Custom If Statements (AppServiceProvider boot method)" | ||
}, | ||
"Blade-directive": { | ||
"prefix": "Blade::directive", | ||
"body": [ | ||
"Blade::directive('${1:datetime}', function ($${2:expression}) {", | ||
" ${3:return \"<?php echo ($$expression)->format('m/d/Y H:i'); ?>\";}", | ||
"});" | ||
], | ||
"description": "Custom directive (AppServiceProvider boot method)" | ||
}, | ||
"Blade-stringable": { | ||
"prefix": "Blade::stringable", | ||
"body": [ | ||
"Blade::stringable(function (${1:Money} $${2:money}) {", | ||
" ${3:return $$money->formatTo('en_GB');}", | ||
"});" | ||
], | ||
"description": "Custom echo handlers (AppServiceProvider boot method)" | ||
}, | ||
"Blade-render": { | ||
"prefix": "Blade::render", | ||
"body": "Blade::render(${1:'Blade template string'}, ${2:\\$data});", | ||
"description": "Transform a raw Blade template string into valid HTML (Laravel 9.x)" | ||
}, | ||
"Blade-renderComponent": { | ||
"prefix": "Blade::renderComponent", | ||
"body": "Blade::renderComponent(new ${1:HelloComponent}(${2:\\$params}));", | ||
"description": "Render a given class component by passing the component instance to the method (Laravel 9.x)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"Path-elixir": { | ||
"prefix": "lv:elixir", | ||
"body": "{{ elixir('${1:file}') }}", | ||
"description": "(deprecated) elixir path" | ||
}, | ||
"Path-mix": { | ||
"prefix": "lv:mix", | ||
"body": "{{ mix('${1:file}') }}", | ||
"description": "mix path" | ||
}, | ||
"String-trans": { | ||
"prefix": "lv:trans", | ||
"body": "{{ trans('$1') }}", | ||
"description": "trans" | ||
}, | ||
"URL-action": { | ||
"prefix": "lv:action", | ||
"body": "{{ action('${1:ControllerName}', [${2:'id'=>1}]) }}", | ||
"description": "URL-action" | ||
}, | ||
"URL-secure-asset": { | ||
"prefix": "lv:secure-asset", | ||
"body": "{{ secure_asset('$1', ${2:\\$title}, ${3:\\$attributes=[]}) }}", | ||
"description": "URL-secure-asset" | ||
}, | ||
"URL-url": { | ||
"prefix": "lv:url", | ||
"body": "{{ url('${1:url}', [$2]) }}", | ||
"description": "URL-url" | ||
}, | ||
"URL-asset": { | ||
"prefix": "lv:asset", | ||
"body": "{{ asset('$1') }}", | ||
"description": "URL-asset" | ||
}, | ||
"URL-route": { | ||
"prefix": "lv:route", | ||
"body": "{{ route('${1:routeName}', [${2:'id'=>1}]) }}", | ||
"description": "URL-route" | ||
}, | ||
"Form-csrf-field": { | ||
"prefix": "lv:csrf-field", | ||
"body": "{{ csrf_field() }}", | ||
"description": "CSRF hidden field" | ||
}, | ||
"csrf-token": { | ||
"prefix": "lv:csrf-token", | ||
"body": "{{ csrf_token() }}", | ||
"description": "CSRF token" | ||
}, | ||
"Paginate-links": { | ||
"prefix": "lv:pagination-links", | ||
"body": "{{ \\$${1:collection}->links() }}", | ||
"description": "pagination links" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"livewireStyles": { | ||
"prefix": "livewire:styles", | ||
"body": "@livewireStyles", | ||
"description": "Livewire Styles directive" | ||
}, | ||
"livewireScripts": { | ||
"prefix": "livewire:scripts", | ||
"body": "@livewireScripts", | ||
"description": "Livewire Scripts directive" | ||
}, | ||
"livewire-component": { | ||
"prefix": "livewire:component", | ||
"body": "@livewire('${1:component}', ['${2:user}' => \\$${3:user}]${4:, key(\\$$3->id)})", | ||
"description": "Livewire nesting components" | ||
} | ||
} |
Oops, something went wrong.