updated various snippets
This commit is contained in:
parent
1bc953bc44
commit
e27b91fc14
@ -19,10 +19,11 @@
|
|||||||
<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="Application Name">
|
||||||
|
|
||||||
<!-- Privacy -->
|
<!-- Privacy -->
|
||||||
<meta name="twitter:dnt" content="on">
|
<meta name="twitter:dnt" content="on">
|
||||||
@ -31,33 +32,41 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<!-- 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="{{ url('/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="{{ url('/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="{{ url('/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.remove('light')
|
||||||
|
document.documentElement.classList.add('dark')
|
||||||
|
}
|
||||||
|
</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-slate-50">
|
@inertia
|
||||||
@yield('body')
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<snippet>
|
<snippet>
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
<div class="">
|
<div class="grid auto-rows-max gap-y-0">
|
||||||
<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 -->
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
</head>
|
</head>
|
||||||
<body class="font-sans antialiased">
|
<body class="font-sans antialiased">
|
||||||
<div id="app" class="min-h-screen bg-slate-50">
|
<div id="app" class="min-h-screen bg-neutral-100">
|
||||||
<!-- -->
|
<!-- -->
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
<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(),
|
'${2:models}' => ${1:MODEL}::where('user_id', \$request->user()->id)->paginate(),
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('${2:models}.index')->with(\$data);
|
return Inertia::render('${2:models}/Index')->with(\$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(${1:MODEL} \$${3:model})
|
public function show(${1:MODEL} \$${3:model})
|
||||||
@ -17,14 +18,14 @@ public function show(${1:MODEL} \$${3:model})
|
|||||||
'${3:model}' => \$${3:model},
|
'${3:model}' => \$${3:model},
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('${2:models}.show')->with(\$data);
|
return Inertia::render('${2:models}/Show')->with(\$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
\$data = [];
|
\$data = [];
|
||||||
|
|
||||||
return view('${2:models}.create')->with(\$data);
|
return Inertia::render('${2:models}/Create')->with(\$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request \$request)
|
public function store(Request \$request)
|
||||||
@ -33,21 +34,21 @@ public function store(Request \$request)
|
|||||||
// assign model fields
|
// assign model fields
|
||||||
|
|
||||||
if (\$${3:model}->save()) {
|
if (\$${3:model}->save()) {
|
||||||
\$request->session()->flash('status', "Successfully added {\$${3:model}->${4:field}}.");
|
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully added {\$${3:model}->${4:field}}."]);
|
||||||
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully added {\$${3:model}->${4:field}}.");
|
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully added {\$${3:model}->${4:field}}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
\$request->session()->flash('error', 'Unable to save that ${3:model}.');
|
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to save that ${3:model}."]);
|
||||||
return redirect()->back()->with('error', 'Unable to save that ${3:model}.');
|
return redirect()->back()->with('error', 'Unable to save that ${3:model}.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit(${1:MODEL} \$${3:model})
|
public function edit(Request \$request, ${1:MODEL} \$${3:model})
|
||||||
{
|
{
|
||||||
\$data = [
|
\$data = [
|
||||||
'${3:model}' => \$${3:model},
|
'${3:model}' => \$${3:model},
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('${2:models}.edit')->with(\$data);
|
return Inertia::render('${2:models}/Edit')->with(\$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request \$request, ${1:MODEL} \$${3:model})
|
public function update(Request \$request, ${1:MODEL} \$${3:model})
|
||||||
@ -55,11 +56,11 @@ public function update(Request \$request, ${1:MODEL} \$${3:model})
|
|||||||
// assign model fields
|
// assign model fields
|
||||||
|
|
||||||
if (\$${3:model}->update()) {
|
if (\$${3:model}->update()) {
|
||||||
\$request->session()->flash('status', "Successfully updated {\$${3:model}->${4:field}}.");
|
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully updated {\$${3:model}->${4:field}}."]);
|
||||||
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully updated {\$${3:model}->${4:field}}.");
|
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully updated {\$${3:model}->${4:field}}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
\$request->session()->flash('error', "Unable to update {\$${3:model}->${4:field}}.");
|
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update ${3:model}."]);
|
||||||
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4:field}}.");
|
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4:field}}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,11 +68,11 @@ public function destroy(Request \$request, ${1:MODEL} \$${3:model})
|
|||||||
{
|
{
|
||||||
\$${4:field} = \$${3:model}->${4:field};
|
\$${4:field} = \$${3:model}->${4:field};
|
||||||
if (\$${3:model}->delete()) {
|
if (\$${3:model}->delete()) {
|
||||||
\$request->session()->flash('status', "Successfully removed {\$${4:field}}.");
|
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully removed {\$${4:field}}."]);
|
||||||
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully removed {\$${4:field}}.");
|
return redirect()->route('dashboard.${2:models}.index')->with('status', "Successfully removed {\$${4:field}}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
\$request->session()->flash('error', "Unable to remove {\$${4:field}}.");
|
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to remove {\$${4:field}}."]);
|
||||||
return redirect()->back()->with('error', "Unable to remove {\$${4:field}}.");
|
return redirect()->back()->with('error', "Unable to remove {\$${4:field}}.");
|
||||||
}
|
}
|
||||||
]]></content>
|
]]></content>
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
<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')
|
||||||
Route::post('/${1:route}', [${3:controller}Controller::class, 'store'])->name('dashboard.${1:route}.store');
|
->name('dashboard.${1:route}.index');
|
||||||
Route::get('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'show'])
|
Route::get('/${1:route}/create', 'create')
|
||||||
->where('${2:model}', '[0-9]+')
|
->name('dashboard.${1:route}.create');
|
||||||
->name('dashboard.${1:route}.show');
|
Route::post('/${1:route}', 'store')
|
||||||
Route::get('/${1:route}/{${2:model}}/edit', [${3:controller}Controller::class, 'edit'])
|
->name('dashboard.${1:route}.store');
|
||||||
->where('${2:model}', '[0-9]+')
|
Route::get('/${1:route}/{${2:model}}', 'show')
|
||||||
->name('dashboard.${1:route}.edit');
|
->where('${2:model}', '[0-9]+')
|
||||||
Route::post('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'update'])
|
->name('dashboard.${1:route}.show');
|
||||||
->where('${2:model}', '[0-9]+')
|
Route::get('/${1:route}/{${2:model}}/edit', 'edit')
|
||||||
->name('dashboard.${1:route}.update');
|
->where('${2:model}', '[0-9]+')
|
||||||
Route::delete('/${1:route}/{${2:model}}', [${3:controller}Controller::class, 'destroy'])
|
->name('dashboard.${1:route}.edit');
|
||||||
->where('${2:model}', '[0-9]+')
|
Route::post('/${1:route}/{${2:model}}', 'update')
|
||||||
->name('dashboard.${1:route}.destroy');
|
->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>
|
]]></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>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useAttrs, reactive, ref, computed, watch, onBeforeMount, onMounted, provide, inject } from 'vue'
|
import { useAttrs, reactive, ref, computed, watch, onBeforeMount, onMounted, provide, inject } from 'vue'
|
||||||
|
import { useForm, usePage } from '@inertiajs/inertia-vue3'
|
||||||
import AppLayout from '@/Layouts/AppLayout.vue'
|
import AppLayout from '@/Layouts/AppLayout.vue'
|
||||||
|
|
||||||
const emit = defineEmits([])
|
const emit = defineEmits([])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user