Compare commits

..

24 Commits

Author SHA1 Message Date
e155e96ff4 updating Laravel model to add events and variables in class name for docblock 2022-10-26 13:15:27 -06:00
bbac3cc205 adding Dashboard to inertia render path 2022-10-26 13:14:54 -06:00
329fd2b11e adding row spacing on form block 2022-10-26 13:14:26 -06:00
886cdc47e6 cleanup of vue component 2022-10-26 13:14:01 -06:00
91063a69d9 removing anchor to version on pdoc 2022-10-26 13:13:52 -06:00
7da1325b1f adding some to the docblocks for Laravel models 2022-10-04 10:17:18 -06:00
6c15670077 adding with property to Laravel model 2022-09-01 15:21:15 -06:00
e2721c6f7d modifying the picture element 2022-08-24 11:22:00 -06:00
cf0f19edd7 adding a package namespace to PHP docblock 2022-08-24 11:21:35 -06:00
a662c6b38e making Vue component have two spaces for tab 2022-08-24 11:21:14 -06:00
baf5d5c8c7 fixing Laravel controller flash message 2022-08-24 11:20:44 -06:00
3b6285a359 adding slots method, variables section, and stubbing out lifecycle hooks 2022-07-19 13:36:17 -06:00
66f8bde4a5 adding docblock and escaping dollar sign 2022-07-19 13:35:45 -06:00
3adc226ad5 adding a few meta tags, script for getting system preference for dark mode 2022-07-19 13:35:22 -06:00
dcc1318a84 adding some more things to ignore by default 2022-07-19 13:34:55 -06:00
7cbc4e1ef3 adding various meta tags, updating some others 2022-07-19 13:34:33 -06:00
2f396e54ac tweaking some index workers and padding 2022-07-19 13:33:50 -06:00
4f6935a8a3 removing a lot of commented out font sizes 2022-06-29 13:44:43 -06:00
2b03ffaa02 condensing Laravel routes file 2022-06-14 14:17:57 -06:00
e27b91fc14 updated various snippets 2022-06-14 12:46:10 -06:00
1bc953bc44 adding some various snippets 2022-05-18 09:21:29 -06:00
5d2ef15f59 font sizes getting changed again I guess 2022-05-18 09:21:17 -06:00
d7d579d661 adding search stuff to Laravel model 2022-05-18 09:20:51 -06:00
f809deb2da tweaking vue component 2022-05-18 09:20:29 -06:00
15 changed files with 420 additions and 193 deletions

View File

@ -5,6 +5,7 @@
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"control_character_style": "names",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"fallback_encoding": "UTF-8",
"folder_exclude_patterns":
[
@ -24,13 +25,15 @@
[
"dlig"
],
"git_diff_target": "head",
"hardware_acceleration": "opengl",
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage",
],
"line_padding_bottom": 2,
"index_workers": 4,
"line_padding_bottom": 3,
"line_padding_top": 2,
"material_theme_accent_cyan": true,
"material_theme_bold_tab": true,
@ -40,9 +43,6 @@
"show_line_endings": true,
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true,
/*"font_size": 11,*/
/*"font_size": 9,*/
/*"font_size": 9,*/
/*"font_size": 12,*/
/*"font_size": 11,*/
}

View File

@ -5,7 +5,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<!-- Set the base URL for all relative URLs within the document -->
<base href="{{ url('/') }}">
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
@ -19,45 +21,57 @@
<meta name="rating" content="General">
<meta name="url" content="{{ url('/') }}">
<meta name="subject" content="your website's subject">
<meta name="description" content="A description of the page">
<meta name="subject" content="{{ \$pageSubject ?? "your website's subject" }}"">
<meta name="description" content="{{ \$pageDescription ?? 'A description of the page' }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<meta name="application-name" content="{{ config('app.name', 'Laravel') }}">
<!-- Privacy -->
<meta name="twitter:dnt" content="on">
<meta name="pinterest" content="nopin" description="No pinning allowed.">
<!-- analytics -->
<!-- -->
<!-- Helps prevent duplicate content issues -->
<link href="{{ route()->current() }}" rel="canonical">
{{-- <link href="{{ route()->current() }}" rel="canonical"> --}}
<!-- Gives a reference to a location in your document that may be in another language -->
<link href="#" rel="alternate" hreflang="de">
{{-- <link href="#" rel="alternate" hreflang="de"> --}}
<link href="{{ url('copyright.html') }}" rel="copyright" integrity="{{ env('INTEGRITY_HASH_COPYRIGHT_HTML') }}">
<!-- Favicon -->
<link href="{{ url('/favicon.ico') }}" rel="icon" sizes="16x16" type="image/icon">
<link href="{{ url('/favicon.svg') }}" rel="icon" type="image/svg+xml">
<link href="{{ url('/favicon.png') }}" rel="icon" sizes="192x192">
<link href="{{ url('/favicon.ico') }}" rel="icon" sizes="16x16" type="image/icon" integrity="{{ env('INTEGRITY_HASH_FAVICON_ICO') }}">
<link href="{{ url('/favicon.svg') }}" rel="icon" type="image/svg+xml" integrity="{{ env('INTEGRITY_HASH_FAVICON_SVG') }}">
<link href="{{ url('/favicon.png') }}" rel="icon" sizes="192x192" integrity="{{ env('INTEGRITY_HASH_FAVICON_PNG') }}">
<!-- Font preloads (should be done for each font file) -->
<link href="{{ asset('fonts/fontfam/font.woff2') }}" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
<link href="{{ url('fonts/fontfam/font.woff2') }}" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet" media="screen">
<link href="{{ mix('/css/app.css') }}" rel="stylesheet" media="all" integrity="{{ env('INTEGRITY_HASH_APP_CSS') }}">
@yield('css')
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
@yield('js')
<script>
if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
document.documentElement.classList.add("dark"); localStorage.theme = "dark";
} else {
document.documentElement.classList.remove("dark"); localStorage.theme = "light";
}
</script>
@routes
<script src="{{ mix('/js/app.js') }}" integrity="{{ env('INTEGRITY_HASH_APP_JS') }}" defer></script>
@inertiaHead
</head>
<body class="font-sans antialiased">
<div id="app" class="min-h-screen bg-slate-50">
@yield('body')
</div>
@inertia
</body>
</html>

View File

@ -0,0 +1,36 @@
<snippet>
<content><![CDATA[
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
-
### Changed
-
### Removed
-
## [1.0.0] - 20XX-01-01
### Added
-
### Changed
-
### Removed
-
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>changelog</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View File

@ -1,8 +1,9 @@
<snippet>
<content><![CDATA[
<div class="">
<label for="${1:foo}">${2:Foo}</label>
<input type="${3:text}" id="${1:foo}" name="${1:foo}" value="" placeholder="${4:placeholder text}">
<div class="grid auto-rows-max gap-y-1">
<label for="${1:foo}" class="">${2:Foo}</label>
<input type="${3:text}" id="${1:foo}" name="${1:foo}" value="" class="" placeholder="${4:placeholder text}">
<p>Input error</p>
</div>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

View File

@ -8,24 +8,26 @@
docker-compose.override.yml
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/storage/*.key
# Directories
/node_modules
/public/build
/public/hot
/public/storage
/vendor
### Editor Specific
# Files
${1:*}.sublime-project
${1:*}.sublime-workspace
/*.sublime-project
/*.sublime-workspace
# Directories
.idea
.vscode
/.idea
/.vscode
### System Specific
# Files

View File

@ -6,6 +6,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Set the base URL for all relative URLs within the document -->
<base href="https://example.com/">
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
@ -25,6 +28,7 @@
<!-- Privacy -->
<meta name="twitter:dnt" content="on">
<meta name="pinterest" content="nopin" description="No pinning allowed.">
<!-- analytics -->
<!-- -->
@ -62,14 +66,21 @@
<link href="https://example.com/css/print.css" rel="stylesheet" media="print">
<!-- JS that must be executed before the document is loaded -->
<script>
if (localStorage.theme === "dark" || (!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
document.documentElement.classList.add("dark"); localStorage.theme = "dark";
} else {
document.documentElement.classList.remove("dark"); localStorage.theme = "light";
}
</script>
<script src="https://example.com/js/vendor/axios.min.js" defer></script>
<script src="https://example.com/js/vendor/vue.min.js" defer></script>
<script src="https://example.com/js/app.js" defer></script>
<!-- -->
</head>
<body class="font-sans antialiased">
<div id="app" class="min-h-screen bg-slate-50">
<!-- -->
<div id="app" class="min-h-screen bg-neutral-100">
<!-- content here -->
</div>
</body>
</html>

View File

@ -0,0 +1,20 @@
<snippet>
<content><![CDATA[
<img alt="alt text"
loading="lazy"
decoding="async"
height="1080"
width="1920"
srcset="${1:some_image}_sd_640.jpg?w=50&fm=jpg&fl=progressive 640w,
${1:some_image}_hd_720.jpg?w=100&fm=jpg&fl=progressive 720w,
${1:some_image}_hd_1920.jpg?w=200&fm=jpg&fl=progressive 1920w"
sizes="(max-width: 640px) 640px,
(max-width: 720px) 720px,
1920px"
src="${1:some_image}_hd_1920.jpg">
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>img</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View File

@ -1,78 +1,79 @@
<snippet>
<content><![CDATA[
use Illuminate\Support\Facades\Auth;
use App\Models\\${1:Model};
use Inertia\Inertia;
public function index()
public function index(Request \$request)
{
\$data = [
'${2:models}' => ${1:MODEL}::where('user_id', Auth::id())->paginate(),
'all${2:Models}' => ${1:Model}::where('user_id', \$request->user()->id)->paginate(),
];
return view('${2:models}.index')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Index')->with(\$data);
}
public function show(${1:MODEL} \$${3:model})
public function show(${1:Model} \$${4:model})
{
\$data = [
'${3:model}' => \$${3:model},
'${4:model}' => \$${4:model},
];
return view('${2:models}.show')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Show')->with(\$data);
}
public function create()
{
\$data = [];
return view('${2:models}.create')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Create')->with(\$data);
}
public function store(Request \$request)
{
\$${3:model} = new ${1:MODEL}();
\$${4:model} = new ${1:Model}();
// assign model fields
if (\$${3:model}->save()) {
\$request->session()->flash('status', "Successfully added {\$${3:model}->${4:field}}.");
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully added {\$${3:model}->${4:field}}.");
if (\$${4:model}->save()) {
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully added {\$${4:model}->${5:field}}."]);
return redirect()->route('dashboard.${3:models}.index')->with('status', "Successfully added {\$${4:model}->${5:field}}.");
}
\$request->session()->flash('error', 'Unable to save that ${3:model}.');
return redirect()->back()->with('error', 'Unable to save that ${3:model}.');
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to save that ${4:model}."]);
return redirect()->back()->with('error', 'Unable to save that ${4:model}.');
}
public function edit(${1:MODEL} \$${3:model})
public function edit(Request \$request, ${1:Model} \$${4:model})
{
\$data = [
'${3:model}' => \$${3:model},
'${4:model}' => \$${4:model},
];
return view('${2:models}.edit')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Edit')->with(\$data);
}
public function update(Request \$request, ${1:MODEL} \$${3:model})
public function update(Request \$request, ${1:Model} \$${4:model})
{
// assign model fields
if (\$${3:model}->update()) {
\$request->session()->flash('status', "Successfully updated {\$${3:model}->${4:field}}.");
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully updated {\$${3:model}->${4:field}}.");
if (\$${4:model}->update()) {
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully updated {\$${4:model}->${5:field}}."]);
return redirect()->route('dashboard.${3:models}.index')->with('status', "Successfully updated {\$${4:model}->${5:field}}.");
}
\$request->session()->flash('error', "Unable to update {\$${3:model}->${4:field}}.");
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4:field}}.");
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update {\$${4:model}->${5:field}}."]);
return redirect()->back()->with('error', "Unable to update {\$${4:model}->${5:field}}.");
}
public function destroy(Request \$request, ${1:MODEL} \$${3:model})
public function destroy(Request \$request, ${1:Model} \$${4:model})
{
\$${4:field} = \$${3:model}->${4:field};
if (\$${3:model}->delete()) {
\$request->session()->flash('status', "Successfully removed {\$${4:field}}.");
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully removed {\$${4:field}}.");
\$${5:field} = \$${4:model}->${5:field};
if (\$${4:model}->delete()) {
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully removed {\$${5:field}}."]);
return redirect()->route('dashboard.${3:models}.index')->with('status', "Successfully removed {\$${5:field}}.");
}
\$request->session()->flash('error', "Unable to remove {\$${4:field}}.");
return redirect()->back()->with('error', "Unable to remove {\$${4:field}}.");
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to remove {\$${5:field}}."]);
return redirect()->back()->with('error', "Unable to remove {\$${5:field}}.");
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

View File

@ -0,0 +1,53 @@
<snippet>
<content><![CDATA[
<?php
namespace App\Models\Traits;
trait HasUidTrait
{
/**
* Ensure that when a model is saving, a unique ID
* is set for the model.
*
* @since 1.0.0
*
* @return void
*/
public static function bootHasUidTrait(): void
{
//
}
/**
* Initialize logic.
*
* @since 1.0.0
*
* @return void
*/
protected function initializeHasUidTrait(): void
{
\$this->id = \$this->generateUid();
}
/**
* Generates a cryptographically safe unique ID.
*
* @since 1.0.0
*
* @return string
*/
public function generateUid(): string
{
\$bytes = openssl_random_pseudo_bytes(env('APP_UID_BYTES', 8));
return bin2hex(\$bytes);
}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>hasuid</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View File

@ -1,44 +1,69 @@
<snippet>
<content><![CDATA[
use App\Models\Traits\HasUidTrait;
use App\Events\${1:Model}Created;
use App\Events\${1:Model}Creating;
use App\Events\${1:Model}Deleted;
use App\Events\${1:Model}Deleting;
use App\Events\${1:Model}Deleting;
use App\Events\${1:Model}Replicating;
use App\Events\${1:Model}Restored;
use App\Events\${1:Model}Restoring;
use App\Events\${1:Model}Retrieved;
use App\Events\${1:Model}Saved;
use App\Events\${1:Model}Saving;
use App\Events\${1:Model}Updated;
use App\Events\${1:Model}Updating;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laravel\Scout\Searchable;
use HasUidTrait;
use Prunable;
use Searchable;
/** @var string */
protected \$table = '';
/** @var string */
protected \$keyType = 'string';
/** @var bool */
public \$incrementing = false;
/** @var string[] */
/** @var array<int,string> */
protected \$fillable = [];
/** @var string[] */
/** @var array<int,string> */
protected \$hidden = [];
/** @var array */
/** @var array<string,string> */
protected \$casts = [];
/** @var string[] */
/** @var array<int,string> */
protected \$dates = [];
/** @var string[] */
/** @var array<int,string> */
protected \$appends = [];
/** @var array */
/** @var array<int,string> */
protected \$with = [];
/** @var array<int,string> */
protected \$touches = [];
/** @var array */
protected \$dispatchesEvents = [];
/** @var array<int,string> */
protected \$dispatchesEvents = [
//'retrieved' => ${1:Model}Retrieved::class,
//'creating' => ${1:Model}Creating::class,
//'created' => ${1:Model}Created::class,
//'updating' => ${1:Model}Updating::class,
//'updated' => ${1:Model}Updated::class,
//'deleting' => ${1:Model}Deleting::class,
//'deleted' => ${1:Model}Deleted::class,
//'deleting' => ${1:Model}Deleting::class,
//'saving' => ${1:Model}Saving::class,
//'saved' => ${1:Model}Saved::class,
//'restoring' => ${1:Model}Restoring::class,
//'restored' => ${1:Model}Restored::class,
//'replicating' => ${1:Model}Replicating::class,
];
/*
/**
|--------------------------------------------------------------------------
| Class Constants
|--------------------------------------------------------------------------
@ -47,7 +72,7 @@ protected \$dispatchesEvents = [];
//
/*
/**
|--------------------------------------------------------------------------
| Custom/Private Methods
|--------------------------------------------------------------------------
@ -57,18 +82,20 @@ protected \$dispatchesEvents = [];
/**
* Get the prunable model query.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function prunable(): Builder
{
//return static::where('created_at', '<=', now()->subMonth());
// return static::where('deleted_at', '<=', now()->subMonth());
}
/**
* Prepare the model for pruning.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return void
@ -78,7 +105,63 @@ protected function pruning(): void
//
}
/*
/**
* Get the value used to index the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return mixed
*/
public function getScoutKey()
{
return \$this->id;
}
/**
* Get the key name used to index the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return string
*/
public function getScoutKeyName(): string
{
return 'id';
}
/**
* Get the name of the index associated with the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return string
*/
public function searchableAs(): string
{
return 'prefix_models_index';
}
/**
* Get the indexable data array for the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return array
*/
public function toSearchableArray(): array
{
\$payload = \$this->toArray();
// modify here...
return \$payload;
}
/**
|--------------------------------------------------------------------------
| Accessors
|--------------------------------------------------------------------------
@ -88,6 +171,7 @@ protected function pruning(): void
/**
* An accessor.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute
@ -95,11 +179,12 @@ protected function pruning(): void
protected function attrName(): Attribute
{
return Attribute::make(
get: fn ($value, $attributes) => $attributes['foo'],
get: fn (\$value, \$attributes) => \$attributes['foo'],
set: fn (\$value, \$attributes) => \$attributes['foo'],
);
}
/*
/**
|--------------------------------------------------------------------------
| Mutators
|--------------------------------------------------------------------------
@ -108,7 +193,7 @@ protected function attrName(): Attribute
//
/*
/**
|--------------------------------------------------------------------------
| Scopes
|--------------------------------------------------------------------------
@ -117,14 +202,28 @@ protected function attrName(): Attribute
//
/*
/**
|--------------------------------------------------------------------------
| Relationships
|--------------------------------------------------------------------------
|
*/
//
/**
* Something relationship.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function something(): BelongsTo
{
return \$this->belongsTo(
related: Something::class,
foreignKey: 'something_id',
);
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>laramodel</tabTrigger>

View File

@ -1,20 +1,14 @@
<snippet>
<content><![CDATA[
Route::get('/${1:route}', [${3:controller}Controller::class, 'index'])->name('dashboard.${1:route}.index');
Route::get('/${1:route}/create', [${3:controller}Controller::class, 'create'])->name('dashboard.${1:route}.create');
Route::post('/${1:route}', [${3:controller}Controller::class, 'store'])->name('dashboard.${1:route}.store');
Route::get('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'show'])
->where('${2:model}', '[0-9]+')
->name('dashboard.${1:route}.show');
Route::get('/${1:route}/{${2:model}}/edit', [${3:controller}Controller::class, 'edit'])
->where('${2:model}', '[0-9]+')
->name('dashboard.${1:route}.edit');
Route::post('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'update'])
->where('${2:model}', '[0-9]+')
->name('dashboard.${1:route}.update');
Route::delete('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'destroy'])
->where('${2:model}', '[0-9]+')
->name('dashboard.${1:route}.destroy');
Route::controller(${3:controller}Controller::class)->group(function () {
Route::get('/${1:route}', 'index')->name('dashboard.${1:route}.index');
Route::get('/${1:route}/create', 'create')->name('dashboard.${1:route}.create');
Route::post('/${1:route}', 'store')->name('dashboard.${1:route}.store');
Route::get('/${1:route}/{${2:model}}', 'show')->where('${2:model}', '[0-9]+')->name('dashboard.${1:route}.show');
Route::get('/${1:route}/{${2:model}}/edit', 'edit')->where('${2:model}', '[0-9]+')->name('dashboard.${1:route}.edit');
Route::post('/${1:route}/{${2:model}}', 'update')->where('${2:model}', '[0-9]+')->name('dashboard.${1:route}.update');
Route::delete('/${1:route}/{${2:model}}', 'destroy')->where('${2:model}', '[0-9]+')->name('dashboard.${1:route}.destroy');
});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>lararoutes</tabTrigger>

View File

@ -1,15 +1,16 @@
<snippet>
<content><![CDATA[
/**
* ${1:Description}
* ${1:Description}.
*
* @since ${5:1.0.0}
* @package Namespace\App\Class
* @since 1.0.0
*
* @param ${2:datatype} ${3:\$variable}
*
* @throws ${4:\Exception}
*
* @return ${6:void}
* @return ${5:void}
*/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

View File

@ -1,47 +1,42 @@
<snippet>
<content><![CDATA[
<picture>
<source type="image/avif"
srcset="
${1:imageName}-640w.avif 640w,
${1:imageName}-1280w.avif 1280w,
${1:imageName}-1920w.avif 1920w
"
sizes="
550px,
(max-width: 768px) calc(100vw - 3em),
(max-width: 1376px) calc(50vw - 8em)
">
<!-- https://github.com/nucliweb/image-element -->
<source
sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
srcset="${1:imageName}-640w.jpg 640w, ${1:imageName}-1280w.jpg 1280w, ${1:imageName}-1920w.jpg 1920w"
type="image/jxl">
<source type="image/webp"
srcset="
${1:imageName}.webp?w=100&fm=webp 100w,
${1:imageName}.webp?w=200&fm=webp 200w,
{1:imageName}.webp
"
sizes="
550px,
(max-width: 768px) calc(100vw - 3em),
(max-width: 1376px) calc(50vw - 8em)
">
<source
sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
srcset="${1:imageName}-640w.avif 640w, ${1:imageName}-1280w.avif 1280w, ${1:imageName}-1920w.avif 1920w"
type="image/avif">
<img
srcset="
${1:imageName}.jpg?w=100&fm=jpg&fl=progressive 100w,
${1:imageName}.jpg?w=200&fm=jpg&fl=progressive 200w,
${1:imageName}.jpg
"
sizes="
550px,
(max-width: 768px) calc(100vw - 3em),
(max-width: 1376px) calc(50vw - 8em)
"
src="${1:imageName}.jpg"
alt="${1:imageName}"
loading="lazy"
decoding="async"
width="{{ $width }}"
height="{{ $height }}">
<source
sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
srcset="${1:imageName}-640w.webp?w=100&fm=webp 100w, ${1:imageName}-1280w.webp?w=200&fm=webp 200w, ${1:imageName}.webp"
type="image/webp">
<source
sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
srcset="${1:imageName}-640w.jpg 640w, ${1:imageName}-1280w.jpg 1280w, ${1:imageName}-1920w.jpg 1920w"
type="image/jpeg">
<img
sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
srcset="${1:imageName}.jpg?w=100&fm=jpg&fl=progressive 100w, ${1:imageName}.jpg?w=200&fm=jpg&fl=progressive 200w, ${1:imageName}.jpg"
src="${1:imageName}.jpg"
alt="${1:imageName}"
<!--
loading="lazy"
decoding="async"
-->
<!--
fetchpriority="high"
decoding="sync"
-->
width="{{ \$width }}"
height="{{ \$height }}">
</picture>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

View File

@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
preserveAspectRatio="xMidYMid meet"
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>preserveAspect</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View File

@ -1,64 +1,55 @@
<snippet>
<content><![CDATA[
<script setup>
import { useAttrs, useSlots, reactive, ref, computed, watch, onBeforeMount, onMounted, onBeforeUpdate, onBeforeUnmount, onUnmounted, provide, inject } from 'vue'
import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3'
import AppLayout from '@/Layouts/AppLayout.vue'
// defines
defineEmits([])
// variables
const props = defineProps({})
// computed properties
// watchers
// lifecycle hooks
onBeforeMount(() => {
//
})
onMounted(() => {
//
})
onBeforeUpdate(() => {
//
})
onBeforeUnmount(() => {
//
})
onUnmounted(() => {
//
})
// methods
</script>
<template>
<app-layout title="${1:TITLE}">
<AppLayout title="${1:TITLE}">
<template #header>${1:TITLE}</template>
<div class="col-span-6">
<div class="col-span-12">
<!-- content goes here -->
</div>
</app-layout>
</AppLayout>
</template>
<script>
import { defineComponent, reactive, ref, computed, watch, onBeforeMount, onMounted, provide, inject } from "vue"
import AppLayout from "@/Layouts/AppLayout.vue"
export default defineComponent({
emits: [],
props: {},
components: {
AppLayout,
},
setup(props, { attrs, slots, emit, expose }) {
let aVariable = ref({})
// computed properties
let compVariable = computed(() => {
//return "foo"
})
// watchers
watch(aVariable, (newValue, oldValue) => {
//
})
// lifecycle hooks
onBeforeMount(() => {
//
})
onMounted(() => {
//
})
// methods
function myMethod() {
aVariable.value = null
}
return {
aVariable,
compVariable,
myMethod,
}
},
})
</script>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vcomp</tabTrigger>