Compare commits

...

11 Commits

7 changed files with 103 additions and 79 deletions

View File

@ -25,7 +25,6 @@
[
"dlig"
],
"font_size": 9,
"git_diff_target": "head",
"hardware_acceleration": "opengl",
"highlight_modified_tabs": true,
@ -44,4 +43,6 @@
"show_line_endings": true,
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true,
/*"font_size": 9,*/
/*"font_size": 11,*/
}

View File

@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
<div class="grid auto-rows-max gap-y-0">
<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>

View File

@ -9,7 +9,7 @@ public function index(Request \$request)
'all${2:Models}' => ${1:Model}::where('user_id', \$request->user()->id)->paginate(),
];
return Inertia::render('${2:Models}/Index')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Index')->with(\$data);
}
public function show(${1:Model} \$${4:model})
@ -18,14 +18,14 @@ public function show(${1:Model} \$${4:model})
'${4:model}' => \$${4:model},
];
return Inertia::render('${2:Models}/Show')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Show')->with(\$data);
}
public function create()
{
\$data = [];
return Inertia::render('${2:Models}/Create')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Create')->with(\$data);
}
public function store(Request \$request)
@ -48,7 +48,7 @@ public function edit(Request \$request, ${1:Model} \$${4:model})
'${4:model}' => \$${4:model},
];
return Inertia::render('${2:Models}/Edit')->with(\$data);
return Inertia::render('Dashboard/${2:Models}/Edit')->with(\$data);
}
public function update(Request \$request, ${1:Model} \$${4:model})
@ -60,7 +60,7 @@ public function update(Request \$request, ${1:Model} \$${4:model})
return redirect()->route('dashboard.${3:models}.index')->with('status', "Successfully updated {\$${4:model}->${5:field}}.");
}
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update ${4:model}."]);
\$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}}.");
}

View File

@ -1,25 +1,30 @@
<snippet>
<content><![CDATA[
use App\Models\Traits\HasUidTrait;
use App\Events\${1:Model}Created;
use App\Events\${1:Model}Creating;
use App\Events\${1:Model}Deleted;
use App\Events\${1:Model}Deleting;
use App\Events\${1:Model}Deleting;
use App\Events\${1:Model}Replicating;
use App\Events\${1:Model}Restored;
use App\Events\${1:Model}Restoring;
use App\Events\${1:Model}Retrieved;
use App\Events\${1:Model}Saved;
use App\Events\${1:Model}Saving;
use App\Events\${1:Model}Updated;
use App\Events\${1:Model}Updating;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laravel\Scout\Searchable;
use HasUidTrait;
use Prunable;
use Searchable;
/** @var string */
protected \$table = '';
/** @var string */
protected \$keyType = 'string';
/** @var bool */
public \$incrementing = false;
/** @var array<int,string> */
protected \$fillable = [];
@ -35,13 +40,30 @@ protected \$dates = [];
/** @var array<int,string> */
protected \$appends = [];
/** @var array<int,string> */
protected \$with = [];
/** @var array<int,string> */
protected \$touches = [];
/** @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
|--------------------------------------------------------------------------
@ -50,7 +72,7 @@ protected \$dispatchesEvents = [];
//
/*
/**
|--------------------------------------------------------------------------
| Custom/Private Methods
|--------------------------------------------------------------------------
@ -60,18 +82,20 @@ protected \$dispatchesEvents = [];
/**
* Get the prunable model query.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function prunable(): Builder
{
//return static::where('created_at', '<=', now()->subMonth());
// return static::where('deleted_at', '<=', now()->subMonth());
}
/**
* Prepare the model for pruning.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return void
@ -84,6 +108,7 @@ protected function pruning(): void
/**
* Get the value used to index the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return mixed
@ -96,6 +121,7 @@ public function getScoutKey()
/**
* Get the key name used to index the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return string
@ -108,18 +134,20 @@ public function getScoutKeyName(): string
/**
* 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 'models_index';
return 'prefix_models_index';
}
/**
* Get the indexable data array for the model.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return array
@ -133,7 +161,7 @@ public function toSearchableArray(): array
return \$payload;
}
/*
/**
|--------------------------------------------------------------------------
| Accessors
|--------------------------------------------------------------------------
@ -143,6 +171,7 @@ public function toSearchableArray(): array
/**
* An accessor.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute
@ -155,7 +184,7 @@ protected function attrName(): Attribute
);
}
/*
/**
|--------------------------------------------------------------------------
| Mutators
|--------------------------------------------------------------------------
@ -164,7 +193,7 @@ protected function attrName(): Attribute
//
/*
/**
|--------------------------------------------------------------------------
| Scopes
|--------------------------------------------------------------------------
@ -173,7 +202,7 @@ protected function attrName(): Attribute
//
/*
/**
|--------------------------------------------------------------------------
| Relationships
|--------------------------------------------------------------------------
@ -183,6 +212,7 @@ protected function attrName(): Attribute
/**
* Something relationship.
*
* @package App\Models\${1:Model}
* @since 1.0.0
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo

View File

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

View File

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

View File

@ -5,15 +5,11 @@ import { useAttrs, useSlots, reactive, ref, computed, watch, onBeforeMount, onMo
import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3'
import AppLayout from '@/Layouts/AppLayout.vue'
const emit = defineEmits([])
const attrs = useAttrs()
const slots = useSlots()
const props = defineProps({})
// defines
defineEmits([])
// variables
const props = defineProps({})
// computed properties
@ -21,24 +17,25 @@ const props = defineProps({})
// lifecycle hooks
onBeforeMount(() => {
//
//
})
onMounted(() => {
//
//
})
onBeforeUpdate(() => {
//
//
})
onBeforeUnmount(() => {
//
//
})
onUnmounted(() => {
//
//
})
// methods
</script>
@ -47,7 +44,7 @@ onUnmounted(() => {
<AppLayout title="${1:TITLE}">
<template #header>${1:TITLE}</template>
<div class="col-span-6">
<div class="col-span-12">
<!-- content goes here -->
</div>
</AppLayout>