Compare commits

..

29 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
15 changed files with 437 additions and 196 deletions

View File

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

View File

@ -5,7 +5,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <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="robots" content="index,follow">
<meta name="googlebot" content="index,follow"> <meta name="googlebot" content="index,follow">
@ -19,45 +21,57 @@
<meta name="rating" content="General"> <meta name="rating" content="General">
<meta name="url" content="{{ url('/') }}"> <meta name="url" content="{{ url('/') }}">
<meta name="subject" content="your website's subject"> <meta name="subject" content="{{ \$pageSubject ?? "your website's subject" }}"">
<meta name="description" content="A description of the page"> <meta name="description" content="{{ \$pageDescription ?? 'A description of the page' }}">
<title>{{ config('app.name', 'Laravel') }}</title> <title>{{ config('app.name', 'Laravel') }}</title>
<meta name="application-name" content="{{ config('app.name', 'Laravel') }}">
<!-- Privacy --> <!-- Privacy -->
<meta name="twitter:dnt" content="on"> <meta name="twitter:dnt" content="on">
<meta name="pinterest" content="nopin" description="No pinning allowed.">
<!-- analytics --> <!-- analytics -->
<!-- --> <!-- -->
<!-- Helps prevent duplicate content issues --> <!-- 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 --> <!-- 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 --> <!-- Favicon -->
<link href="/favicon.ico" rel="icon" sizes="16x16" type="image/icon"> <link href="{{ url('/favicon.ico') }}" rel="icon" sizes="16x16" type="image/icon" integrity="{{ env('INTEGRITY_HASH_FAVICON_ICO') }}">
<link href="/favicon.svg" rel="icon" type="image/svg+xml"> <link href="{{ url('/favicon.svg') }}" rel="icon" type="image/svg+xml" integrity="{{ env('INTEGRITY_HASH_FAVICON_SVG') }}">
<link href="/favicon.png" rel="icon" sizes="192x192"> <link href="{{ url('/favicon.png') }}" rel="icon" sizes="192x192" integrity="{{ env('INTEGRITY_HASH_FAVICON_PNG') }}">
<!-- Font preloads (should be done for each font file) --> <!-- 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 --> <!-- 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') @yield('css')
<!-- Scripts --> <!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script> <script>
@yield('js') 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> </head>
<body class="font-sans antialiased"> <body class="font-sans antialiased">
<div id="app" class="min-h-screen bg-gray-100">
@yield('body')
</div> @inertia
</body> </body>
</html> </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> <snippet>
<content><![CDATA[ <content><![CDATA[
<div class=""> <div class="grid auto-rows-max gap-y-1">
<label for="${1:foo}">${2:Foo}</label> <label for="${1:foo}" class="">${2:Foo}</label>
<input type="${3:text}" id="${1:foo}" name="${1:foo}" value="" placeholder="${4:placeholder text}"> <input type="${3:text}" id="${1:foo}" name="${1:foo}" value="" class="" placeholder="${4:placeholder text}">
<p>Input error</p>
</div> </div>
]]></content> ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

View File

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

View File

@ -6,6 +6,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <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="robots" content="index,follow">
<meta name="googlebot" content="index,follow"> <meta name="googlebot" content="index,follow">
@ -25,6 +28,7 @@
<!-- Privacy --> <!-- Privacy -->
<meta name="twitter:dnt" content="on"> <meta name="twitter:dnt" content="on">
<meta name="pinterest" content="nopin" description="No pinning allowed.">
<!-- analytics --> <!-- analytics -->
<!-- --> <!-- -->
@ -39,40 +43,44 @@
<link href="https://example.com/2003/05/" title="May 2003" rel="archives"> <link href="https://example.com/2003/05/" title="May 2003" rel="archives">
<!-- Android web manifest file --> <!-- 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 --> <!-- Files listing who was involved in this site and copyrights -->
<link href="https://example.com/humans.txt" rel="author"> <link href="https://example.com/humans.txt" rel="author">
<link href="https://example.com/copyright.html" rel="copyright"> <link href="https://example.com/copyright.html" rel="copyright">
<!-- Feeds --> <!-- 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"> <link href="https://example.com/feed.atom" type="application/atom+xml" title="Atom 0.3" rel="alternate">
<!-- Favicon --> <!-- Favicon -->
<link href="/favicon.ico" rel="icon" sizes="16x16" type="image/icon"> <link href="https://example.com/favicon.ico" rel="icon" sizes="16x16" type="image/icon">
<link href="/favicon.svg" rel="icon" type="image/svg+xml"> <link href="https://example.com/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/favicon.png" rel="icon" sizes="192x192"> <link href="https://example.com/favicon.png" rel="icon" sizes="192x192">
<!-- Font preloads (should be done for each font file) --> <!-- 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.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 --> <!-- CSS -->
<link href="https://example.com/css/app.css" rel="stylesheet" media="screen"> <link href="https://example.com/css/app.css" rel="stylesheet" media="screen">
<link href="https://example.com/css/print.css" rel="stylesheet" media="print"> <link href="https://example.com/css/print.css" rel="stylesheet" media="print">
<!-- JS that must be executed before the document is loaded --> <!-- 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/axios.min.js" defer></script>
<script src="https://example.com/js/vendor/vue.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> <script src="https://example.com/js/app.js" defer></script>
<!-- -->
</head> </head>
<body class="font-sans antialiased"> <body class="font-sans antialiased">
<div id="app" class="min-h-screen bg-gray-100"> <div id="app" class="min-h-screen bg-neutral-100">
<!-- --> <!-- content here -->
</div> </div>
</body> </body>
</html> </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> <snippet>
<content><![CDATA[ <content><![CDATA[
use Illuminate\Support\Facades\Auth; use App\Models\\${1:Model};
use Inertia\Inertia;
public function index() public function index(Request \$request)
{ {
\$data = [ \$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 = [ \$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() public function create()
{ {
\$data = []; \$data = [];
return view('${2:models}.create')->with(\$data); return Inertia::render('Dashboard/${2:Models}/Create')->with(\$data);
} }
public function store(Request \$request) public function store(Request \$request)
{ {
\$${3:model} = new ${1:MODEL}(); \$${4:model} = new ${1:Model}();
// assign model fields // assign model fields
if (\$${3:model}->save()) { if (\$${4:model}->save()) {
\$request->session()->flash('status', "Successfully added {\$${3:model}->${4:field}}."); \$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully added {\$${4:model}->${5:field}}."]);
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully added {\$${3:model}->${4: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}.'); \$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to save that ${4:model}."]);
return redirect()->back()->with('error', 'Unable to save that ${3: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 = [ \$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 // assign model fields
if (\$${3:model}->update()) { if (\$${4:model}->update()) {
\$request->session()->flash('status', "Successfully updated {\$${3:model}->${4:field}}."); \$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully updated {\$${4:model}->${5:field}}."]);
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully updated {\$${3:model}->${4: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}}."); \$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update {\$${4:model}->${5:field}}."]);
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4: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}; \$${5:field} = \$${4:model}->${5:field};
if (\$${3:model}->delete()) { if (\$${4:model}->delete()) {
\$request->session()->flash('status', "Successfully removed {\$${4:field}}."); \$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully removed {\$${5:field}}."]);
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully removed {\$${4:field}}."); return redirect()->route('dashboard.${3:models}.index')->with('status', "Successfully removed {\$${5:field}}.");
} }
\$request->session()->flash('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 {\$${4:field}}."); return redirect()->back()->with('error', "Unable to remove {\$${5:field}}.");
} }
]]></content> ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- 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,43 +1,69 @@
<snippet> <snippet>
<content><![CDATA[ <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\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Prunable; use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laravel\Scout\Searchable;
use HasUidTrait;
use Prunable; use Prunable;
use Searchable;
/** @var string */ /** @var string */
protected \$table = ''; protected \$table = '';
/** @var string */ /** @var array<int,string> */
protected \$keyType = 'string';
/** @var bool */
public \$incrementing = false;
/** @var string[] */
protected \$fillable = []; protected \$fillable = [];
/** @var string[] */ /** @var array<int,string> */
protected \$hidden = []; protected \$hidden = [];
/** @var array */ /** @var array<string,string> */
protected \$casts = []; protected \$casts = [];
/** @var string[] */ /** @var array<int,string> */
protected \$dates = []; protected \$dates = [];
/** @var string[] */ /** @var array<int,string> */
protected \$appends = []; protected \$appends = [];
/** @var array */ /** @var array<int,string> */
protected \$with = [];
/** @var array<int,string> */
protected \$touches = []; protected \$touches = [];
/** @var array */ /** @var array<int,string> */
protected \$dispatchesEvents = []; 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 | Class Constants
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -46,7 +72,7 @@ protected \$dispatchesEvents = [];
// //
/* /**
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Custom/Private Methods | Custom/Private Methods
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -56,18 +82,20 @@ protected \$dispatchesEvents = [];
/** /**
* Get the prunable model query. * Get the prunable model query.
* *
* @package App\Models\${1:Model}
* @since 1.0.0 * @since 1.0.0
* *
* @return \Illuminate\Database\Eloquent\Builder * @return \Illuminate\Database\Eloquent\Builder
*/ */
public function prunable(): Builder public function prunable(): Builder
{ {
//return static::where('created_at', '<=', now()->subMonth()); // return static::where('deleted_at', '<=', now()->subMonth());
} }
/** /**
* Prepare the model for pruning. * Prepare the model for pruning.
* *
* @package App\Models\${1:Model}
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -77,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 | 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 | Mutators
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -95,7 +193,7 @@ protected function pruning(): void
// //
/* /**
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Scopes | Scopes
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -104,14 +202,28 @@ protected function pruning(): void
// //
/* /**
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Relationships | 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> ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>laramodel</tabTrigger> <tabTrigger>laramodel</tabTrigger>

View File

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

View File

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

View File

@ -1,47 +1,42 @@
<snippet> <snippet>
<content><![CDATA[ <content><![CDATA[
<picture> <picture>
<source type="image/avif" <!-- https://github.com/nucliweb/image-element -->
srcset=" <source
${1:imageName}-640w.avif 640w, sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
${1:imageName}-1280w.avif 1280w, srcset="${1:imageName}-640w.jpg 640w, ${1:imageName}-1280w.jpg 1280w, ${1:imageName}-1920w.jpg 1920w"
${1:imageName}-1920w.avif 1920w type="image/jxl">
"
sizes="
550px,
(max-width: 768px) calc(100vw - 3em),
(max-width: 1376px) calc(50vw - 8em)
">
<source type="image/webp" <source
srcset=" sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
${1:imageName}.webp?w=100&fm=webp 100w, srcset="${1:imageName}-640w.avif 640w, ${1:imageName}-1280w.avif 1280w, ${1:imageName}-1920w.avif 1920w"
${1:imageName}.webp?w=200&fm=webp 200w, type="image/avif">
{1:imageName}.webp
" <source
sizes=" sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
550px, srcset="${1:imageName}-640w.webp?w=100&fm=webp 100w, ${1:imageName}-1280w.webp?w=200&fm=webp 200w, ${1:imageName}.webp"
(max-width: 768px) calc(100vw - 3em), type="image/webp">
(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.jpg 640w, ${1:imageName}-1280w.jpg 1280w, ${1:imageName}-1920w.jpg 1920w"
type="image/jpeg">
<img <img
srcset=" sizes="550px, (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em)"
${1:imageName}.jpg?w=100&fm=jpg&fl=progressive 100w, srcset="${1:imageName}.jpg?w=100&fm=jpg&fl=progressive 100w, ${1:imageName}.jpg?w=200&fm=jpg&fl=progressive 200w, ${1:imageName}.jpg"
${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" src="${1:imageName}.jpg"
alt="${1:imageName}" alt="${1:imageName}"
<!--
loading="lazy" loading="lazy"
decoding="async" decoding="async"
width="{{ $width }}" -->
height="{{ $height }}"> <!--
fetchpriority="high"
decoding="sync"
-->
width="{{ \$width }}"
height="{{ \$height }}">
</picture> </picture>
]]></content> ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- 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,60 +1,55 @@
<snippet> <snippet>
<content><![CDATA[ <content><![CDATA[
<template> <script setup>
<app-layout title="${1:TITLE}"> import { useAttrs, useSlots, reactive, ref, computed, watch, onBeforeMount, onMounted, onBeforeUpdate, onBeforeUnmount, onUnmounted, provide, inject } from 'vue'
<template #header>${1:TITLE}</template> import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3'
<div class="col-span-6">
<!-- content goes here -->
</div>
</app-layout>
</template>
<script>
import { defineComponent, reactive, ref, computed, watch, onBeforeMount, onMounted } from 'vue'
import AppLayout from '@/Layouts/AppLayout.vue' import AppLayout from '@/Layouts/AppLayout.vue'
export default defineComponent({ // defines
emits: [], defineEmits([])
props: {}, // variables
const props = defineProps({})
components: { // computed properties
AppLayout,
},
setup(props, {context, emit}) { // watchers
let aVariable = reactive({})
let compVariable = computed(() => { // lifecycle hooks
//return 'foo' onBeforeMount(() => {
})
watch(variable, (newValue, oldValue) => {
// //
})
onBeforeMount(() => {
//
})
onMounted(() => {
//
})
function myMethod() {
aVariable.value = null
}
return {
aVariable,
compVariable,
myMethod,
}
},
}) })
onMounted(() => {
//
})
onBeforeUpdate(() => {
//
})
onBeforeUnmount(() => {
//
})
onUnmounted(() => {
//
})
// methods
</script> </script>
<template>
<AppLayout title="${1:TITLE}">
<template #header>${1:TITLE}</template>
<div class="col-span-12">
<!-- content goes here -->
</div>
</AppLayout>
</template>
]]></content> ]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vcomp</tabTrigger> <tabTrigger>vcomp</tabTrigger>