removing a lot of commented out font sizes
This commit is contained in:
parent
2b03ffaa02
commit
4f6935a8a3
@ -40,12 +40,5 @@
|
||||
"show_line_endings": true,
|
||||
"theme": "Material-Theme.sublime-theme",
|
||||
"translate_tabs_to_spaces": true,
|
||||
/*"font_size": 11,*/
|
||||
/*"font_size": 9,*/
|
||||
/*"font_size": 9,*/
|
||||
/*"font_size": 12,*/
|
||||
/*"font_size": 11,*/
|
||||
/*"font_size": 9,*/
|
||||
/*"font_size": 8,*/
|
||||
/*"font_size": 9,*/
|
||||
"font_size": 9,
|
||||
}
|
||||
|
@ -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 -->
|
||||
|
@ -14,7 +14,7 @@ trait HasUidTrait
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function bootHasUidTrait()
|
||||
public static function bootHasUidTrait(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ use App\Models\Traits\HasUidTrait;
|
||||
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;
|
||||
@ -19,25 +20,25 @@ protected \$keyType = 'string';
|
||||
/** @var bool */
|
||||
public \$incrementing = false;
|
||||
|
||||
/** @var string[] */
|
||||
/** @var array<int,string> */
|
||||
protected \$fillable = [];
|
||||
|
||||
/** @var string[] */
|
||||
/** @var array<int,string> */
|
||||
protected \$hidden = [];
|
||||
|
||||
/** @var array */
|
||||
/** @var array<string,string> */
|
||||
protected \$casts = [];
|
||||
|
||||
/** @var string[] */
|
||||
/** @var array<int,string> */
|
||||
protected \$dates = [];
|
||||
|
||||
/** @var string[] */
|
||||
/** @var array<int,string> */
|
||||
protected \$appends = [];
|
||||
|
||||
/** @var array */
|
||||
/** @var array<int,string> */
|
||||
protected \$touches = [];
|
||||
|
||||
/** @var array */
|
||||
/** @var array<int,string> */
|
||||
protected \$dispatchesEvents = [];
|
||||
|
||||
/*
|
||||
@ -150,6 +151,7 @@ protected function attrName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn (\$value, \$attributes) => \$attributes['foo'],
|
||||
set: fn (\$value, \$attributes) => \$attributes['foo'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -178,7 +180,13 @@ protected function attrName(): Attribute
|
||||
|
|
||||
*/
|
||||
|
||||
//
|
||||
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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user