removing a lot of commented out font sizes

This commit is contained in:
2022-06-29 13:44:43 -06:00
parent 2b03ffaa02
commit 4f6935a8a3
4 changed files with 47 additions and 46 deletions

View File

@ -1,79 +1,79 @@
<snippet>
<content><![CDATA[
use App\Models\${1:MODEL};
use App\Models\\${1:Model};
use Inertia\Inertia;
public function index(Request \$request)
{
\$data = [
'${2:models}' => ${1:MODEL}::where('user_id', \$request->user()->id)->paginate(),
'all${2:Models}' => ${1:Model}::where('user_id', \$request->user()->id)->paginate(),
];
return Inertia::render('${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} \$${4:model})
{
\$data = [
'${3:model}' => \$${3:model},
'${4:model}' => \$${4:model},
];
return Inertia::render('${2:models}/Show')->with(\$data);
return Inertia::render('${2:Models}/Show')->with(\$data);
}
public function create()
{
\$data = [];
return Inertia::render('${2:models}/Create')->with(\$data);
return Inertia::render('${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()) {
\$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}}.");
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}}.");
}
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to save that ${3:model}."]);
return redirect()->back()->with('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 ${4:model}.');
}
public function edit(Request \$request, ${1:MODEL} \$${3:model})
public function edit(Request \$request, ${1:Model} \$${4:model})
{
\$data = [
'${3:model}' => \$${3:model},
'${4:model}' => \$${4:model},
];
return Inertia::render('${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} \$${4:model})
{
// assign model fields
if (\$${3:model}->update()) {
\$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}}.");
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}}.");
}
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update ${3:model}."]);
return redirect()->back()->with('error', "Unable to update {\$${3:model}->${4:field}}.");
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to update ${4:model}."]);
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};
if (\$${3:model}->delete()) {
\$request->session()->flash('flash', ['bannerStyle' => 'success', 'banner' => "Successfully removed {\$${4:field}}."]);
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}}.");
}
\$request->session()->flash('flash', ['bannerStyle' => 'danger', 'banner' => "Unable to remove {\$${4:field}}."]);
return redirect()->back()->with('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 {\$${5:field}}.");
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->