Compare commits

...

35 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
54bbaf1918
font size got reset I guess... 2022-03-28 12:50:51 -06:00
3b61555dad
using full URL for favicons 2022-03-28 12:50:33 -06:00
fd1991e5a3
changing from single quote to double quote 2022-03-28 12:50:09 -06:00
07cf7c8b4a
adding some full URLs, removing woff (not woff2) 2022-03-28 12:49:49 -06:00
89fd4b6ea3
adding attribute accessor 2022-03-28 12:49:15 -06:00
1d50c81dc7
moving Vue3 component snippet to Composition API 2022-03-16 12:20:02 -06:00
961b012daa
changing some typehinting in comments 2022-03-16 12:19:45 -06:00
a50d03fdb5
set font size to 10 2022-03-16 12:19:24 -06:00
7a4e7bf2dd
Updating laravel controller snippet to include session flashing 2021-12-14 09:43:26 -07:00
1c77ddde0b
Tweaking many components after using them for a while 2021-12-14 09:41:00 -07:00
8916410167
Updating vue component snippet to vue 3 2021-10-26 09:46:48 -06:00
16 changed files with 455 additions and 159 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,7 +43,6 @@
"show_line_endings": true,
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true,
/*"font_size": 9,*/
/*"font_size": 11,*/
/*"font_size": 9,*/
/*"font_size": 9,*/
}

View File

@ -1,68 +1,77 @@
<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="no-js">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<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">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="x-dns-prefetch-control" content="off">
<meta name="google" content="notranslate">
<meta name="google" content="nositelinkssearchbox">
<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="/favicon.ico" rel="icon" sizes="16x16" type="image/icon">
<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/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="{{ asset('fonts/fontfam/font.woff') }}" rel="preload" as="font" type="font/woff" 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="{{ asset('css/print.css') }}" rel="stylesheet" media="print">
<link href="{{ mix('/css/app.css') }}" rel="stylesheet" media="all" integrity="{{ env('INTEGRITY_HASH_APP_CSS') }}">
@yield('css')
<!-- JS that must be executed before the document is loaded -->
<script type="module">
document.documentElement.classList.remove('no-js');
document.documentElement.classList.add('js');
<!-- Scripts -->
<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>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
@yield('js')
@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-gray-100">
@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

@ -2,10 +2,9 @@
<content><![CDATA[
@font-face {
font-family: "${1:FontFamily}";
src: url(fonts/${1:FontFamily}/${2:FontName}.woff2) format("woff2"),
url(fonts/${1:FontFamily}/${2:FontName}.woff) format("woff");
font-weight: 400; /* normal/400, bold/700 */
font-style: normal; /* normal, italic, oblique */
src: url(fonts/${1:FontFamily}/${2:FontName}.woff2) format("woff2");
font-weight: 400; /* thin/100, extralight/200, light/300, normal/400, medium/500, semibold/600, bold/700, extrabold/800, black/900 */
font-style: normal; /* normal, italic, oblique, oblique 10deg */
font-display: swap; /* swap, fallback */
}

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 -->
<!-- -->
@ -39,40 +43,44 @@
<link href="https://example.com/2003/05/" title="May 2003" rel="archives">
<!-- Android web manifest file -->
<link href="/.webmanifest" rel="manifest">
<link href="https://example.com/.webmanifest" rel="manifest">
<!-- Files listing who was involved in this site and copyrights -->
<link href="https://example.com/humans.txt" rel="author">
<link href="https://example.com/copyright.html" rel="copyright">
<!-- Feeds -->
<link href="https://feeds.feedburner.com/example" type="application/rss+xml" title="RSS" rel="alternate">
<link href="https://example.com/rss.xml" type="application/rss+xml" title="RSS" rel="alternate">
<link href="https://example.com/feed.atom" type="application/atom+xml" title="Atom 0.3" rel="alternate">
<!-- Favicon -->
<link href="/favicon.ico" rel="icon" sizes="16x16" type="image/icon">
<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/favicon.png" rel="icon" sizes="192x192">
<link href="https://example.com/favicon.ico" rel="icon" sizes="16x16" type="image/icon">
<link href="https://example.com/favicon.svg" rel="icon" type="image/svg+xml">
<link href="https://example.com/favicon.png" rel="icon" sizes="192x192">
<!-- Font preloads (should be done for each font file) -->
<link href="https://example.com/fonts/fontfam/font.woff2" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
<link href="https://example.com/fonts/fontfam/font.woff" rel="preload" as="font" type="font/woff" crossorigin="anonymous">
<!-- CSS -->
<link href="https://example.com/css/app.css" rel="stylesheet" media="screen">
<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>
<div id="app">
<!-- -->
<body class="font-sans antialiased">
<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,70 +1,79 @@
<snippet>
<content><![CDATA[
public function index()
use App\Models\\${1:Model};
use Inertia\Inertia;
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()) {
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully added {\$${3:model}->${4:field}} as a ${3:model}.");
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}}.");
}
return redirect()->back()->with('error', 'Unable to save that ${3:model}. Check the error logs.');
\$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()) {
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}}.");
}
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4:field}}. Check the error logs.");
\$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(${1:MODEL} \$${3:model})
public function destroy(Request \$request, ${1:Model} \$${4:model})
{
\$${4:field} = \$${3:model}->${4:field};
if (\$${3:model}->delete()) {
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}}.");
}
return redirect()->back()->with('error', "Unable to remove {\$${4:field}}. Check the error logs.");
\$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,29 +1,69 @@
<snippet>
<content><![CDATA[
use Prunable; // \Illuminate\Database\Eloquent\Prunable
use HasUidTrait; // \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 Prunable;
use Searchable;
/** @var string */
protected \$table = '';
protected \$keyType = 'string';
public \$incrementing = false;
/** @var array<int,string> */
protected \$fillable = [];
/** @var array<int,string> */
protected \$hidden = [];
/** @var array<string,string> */
protected \$casts = [];
/** @var array<int,string> */
protected \$dates = [];
/** @var array<int,string> */
protected \$appends = [];
/** @var array<int,string> */
protected \$with = [];
/** @var array<int,string> */
protected \$touches = [];
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
|--------------------------------------------------------------------------
@ -32,7 +72,7 @@ protected \$dispatchesEvents = [];
//
/*
/**
|--------------------------------------------------------------------------
| Custom/Private Methods
|--------------------------------------------------------------------------
@ -42,16 +82,22 @@ 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
*/
protected function pruning(): void
@ -59,16 +105,86 @@ 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
|--------------------------------------------------------------------------
|
*/
//
/**
* An accessor.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute
*/
protected function attrName(): Attribute
{
return Attribute::make(
get: fn (\$value, \$attributes) => \$attributes['foo'],
set: fn (\$value, \$attributes) => \$attributes['foo'],
);
}
/*
/**
|--------------------------------------------------------------------------
| Mutators
|--------------------------------------------------------------------------
@ -77,7 +193,7 @@ protected function pruning(): void
//
/*
/**
|--------------------------------------------------------------------------
| Scopes
|--------------------------------------------------------------------------
@ -86,14 +202,28 @@ protected function pruning(): void
//
/*
/**
|--------------------------------------------------------------------------
| 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">
<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
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)
"
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"
width="{{ $width }}"
height="{{ $height }}">
-->
<!--
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,27 +1,55 @@
<snippet>
<content><![CDATA[
<template>
<div class="v-root"></div>
</template>
<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'
<script>
import { defineComponent } from 'vue'
// defines
defineEmits([])
export default defineComponent({
props: {},
// variables
const props = defineProps({})
data() {
return {}
},
// computed properties
computed: {},
// watchers
mounted() {},
methods: {},
// lifecycle hooks
onBeforeMount(() => {
//
})
onMounted(() => {
//
})
onBeforeUpdate(() => {
//
})
onBeforeUnmount(() => {
//
})
onUnmounted(() => {
//
})
// methods
</script>
<template>
<AppLayout title="${1:TITLE}">
<template #header>${1:TITLE}</template>
<div class="col-span-12">
<!-- content goes here -->
</div>
</AppLayout>
</template>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vcomp</tabTrigger>