Compare commits
35 Commits
220e16aa36
...
master
Author | SHA1 | Date | |
---|---|---|---|
e155e96ff4 | |||
bbac3cc205 | |||
329fd2b11e | |||
886cdc47e6 | |||
91063a69d9 | |||
7da1325b1f | |||
6c15670077 | |||
e2721c6f7d | |||
cf0f19edd7 | |||
a662c6b38e | |||
baf5d5c8c7 | |||
3b6285a359 | |||
66f8bde4a5 | |||
3adc226ad5 | |||
dcc1318a84 | |||
7cbc4e1ef3 | |||
2f396e54ac | |||
4f6935a8a3 | |||
2b03ffaa02 | |||
e27b91fc14 | |||
1bc953bc44 | |||
5d2ef15f59 | |||
d7d579d661 | |||
f809deb2da | |||
54bbaf1918 | |||
3b61555dad | |||
fd1991e5a3 | |||
07cf7c8b4a | |||
89fd4b6ea3 | |||
1d50c81dc7 | |||
961b012daa | |||
a50d03fdb5 | |||
7a4e7bf2dd | |||
1c77ddde0b | |||
8916410167 |
@ -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,*/
|
||||
}
|
||||
|
@ -1,68 +1,77 @@
|
||||
<snippet>
|
||||
<content><,
|
||||
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>
|
@ -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 */
|
||||
}
|
||||
|
||||
|
@ -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 -->
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
20
Packages/User/img.sublime-snippet
Normal file
20
Packages/User/img.sublime-snippet
Normal 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>
|
@ -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 -->
|
||||
|
53
Packages/User/laravel_hasuidtrait.sublime-snippet
Normal file
53
Packages/User/laravel_hasuidtrait.sublime-snippet
Normal 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>
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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 -->
|
||||
|
@ -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 -->
|
||||
|
9
Packages/User/preserveAspectRatio.sublime-snippet
Normal file
9
Packages/User/preserveAspectRatio.sublime-snippet
Normal 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>
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user