Compare commits
4 Commits
54bbaf1918
...
1bc953bc44
Author | SHA1 | Date | |
---|---|---|---|
1bc953bc44
|
|||
5d2ef15f59
|
|||
d7d579d661
|
|||
f809deb2da
|
@ -45,4 +45,7 @@
|
|||||||
/*"font_size": 9,*/
|
/*"font_size": 9,*/
|
||||||
/*"font_size": 12,*/
|
/*"font_size": 12,*/
|
||||||
/*"font_size": 11,*/
|
/*"font_size": 11,*/
|
||||||
|
/*"font_size": 9,*/
|
||||||
|
/*"font_size": 8,*/
|
||||||
|
/*"font_size": 9,*/
|
||||||
}
|
}
|
||||||
|
36
Packages/User/changelog.sublime-snippet
Normal file
36
Packages/User/changelog.sublime-snippet
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<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>
|
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>
|
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()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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>
|
@ -4,9 +4,11 @@ use App\Models\Traits\HasUidTrait;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Illuminate\Database\Eloquent\Prunable;
|
use Illuminate\Database\Eloquent\Prunable;
|
||||||
|
use Laravel\Scout\Searchable;
|
||||||
|
|
||||||
use HasUidTrait;
|
use HasUidTrait;
|
||||||
use Prunable;
|
use Prunable;
|
||||||
|
use Searchable;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected \$table = '';
|
protected \$table = '';
|
||||||
@ -78,6 +80,58 @@ protected function pruning(): void
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value used to index the model.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getScoutKey()
|
||||||
|
{
|
||||||
|
return \$this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the key name used to index the model.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getScoutKeyName(): string
|
||||||
|
{
|
||||||
|
return 'id';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the index associated with the model.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function searchableAs(): string
|
||||||
|
{
|
||||||
|
return 'models_index';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the indexable data array for the model.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toSearchableArray(): array
|
||||||
|
{
|
||||||
|
\$payload = \$this->toArray();
|
||||||
|
|
||||||
|
// modify here...
|
||||||
|
|
||||||
|
return \$payload;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Accessors
|
| Accessors
|
||||||
@ -95,7 +149,7 @@ protected function pruning(): void
|
|||||||
protected function attrName(): Attribute
|
protected function attrName(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn ($value, $attributes) => $attributes['foo'],
|
get: fn (\$value, \$attributes) => \$attributes['foo'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,5 +1,25 @@
|
|||||||
<snippet>
|
<snippet>
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
|
<script setup>
|
||||||
|
import { useAttrs, reactive, ref, computed, watch, onBeforeMount, onMounted, provide, inject } from 'vue'
|
||||||
|
import AppLayout from '@/Layouts/AppLayout.vue'
|
||||||
|
|
||||||
|
const emit = defineEmits([])
|
||||||
|
|
||||||
|
const attrs = useAttrs()
|
||||||
|
|
||||||
|
const props = defineProps({})
|
||||||
|
|
||||||
|
// computed properties
|
||||||
|
|
||||||
|
// watchers
|
||||||
|
|
||||||
|
// lifecycle hooks
|
||||||
|
|
||||||
|
// methods
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<app-layout title="${1:TITLE}">
|
<app-layout title="${1:TITLE}">
|
||||||
<template #header>${1:TITLE}</template>
|
<template #header>${1:TITLE}</template>
|
||||||
@ -10,55 +30,6 @@
|
|||||||
</app-layout>
|
</app-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { defineComponent, reactive, ref, computed, watch, onBeforeMount, onMounted, provide, inject } from "vue"
|
|
||||||
import AppLayout from "@/Layouts/AppLayout.vue"
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
emits: [],
|
|
||||||
|
|
||||||
props: {},
|
|
||||||
|
|
||||||
components: {
|
|
||||||
AppLayout,
|
|
||||||
},
|
|
||||||
|
|
||||||
setup(props, { attrs, slots, emit, expose }) {
|
|
||||||
let aVariable = ref({})
|
|
||||||
|
|
||||||
// computed properties
|
|
||||||
let compVariable = computed(() => {
|
|
||||||
//return "foo"
|
|
||||||
})
|
|
||||||
|
|
||||||
// watchers
|
|
||||||
watch(aVariable, (newValue, oldValue) => {
|
|
||||||
//
|
|
||||||
})
|
|
||||||
|
|
||||||
// lifecycle hooks
|
|
||||||
onBeforeMount(() => {
|
|
||||||
//
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
//
|
|
||||||
})
|
|
||||||
|
|
||||||
// methods
|
|
||||||
function myMethod() {
|
|
||||||
aVariable.value = null
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
aVariable,
|
|
||||||
compVariable,
|
|
||||||
myMethod,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
]]></content>
|
]]></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>
|
||||||
|
Reference in New Issue
Block a user