Skip to content

Commit 8675924

Browse files
author
realshade
committed
* фікс форми зв'язаної моделі: повернута загублена плашка, змінена сортировка моделей
1 parent d648cfa commit 8675924

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

app/Http/Controllers/Print/PartTaskController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function addPrinted(PartTaskAddPrintedRequest $request, PartTask $partTas
3333
public function create(Task $task) : View
3434
{
3535
$part = null;
36-
$parts = Part::where('user_id', auth()->id())->get();
36+
$parts = Part::where('user_id', auth()->id())->orderByDesc('id')->get();
3737

3838
return view('print.tasks.parts.form', compact('task', 'part', 'parts'));
3939
}

app/Http/Controllers/Print/TaskController.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ public function create() : View
2323

2424
public function edit(Task $task) : View
2525
{
26-
$parts = Part::where('user_id', auth()->id())->get();
27-
28-
return view('print.tasks.form', compact('task', 'parts'));
26+
return view('print.tasks.form', compact('task'));
2927
}
3028

3129
public function index() : View
3230
{
3331
$tasks = Task::where('user_id', auth()->id())
3432
->orderBy('id', 'desc')
3533
->paginate();
36-
$parts = Part::all();
3734

38-
return view('print.tasks.index', compact('tasks', 'parts'));
35+
return view('print.tasks.index', compact('tasks'));
3936
}
4037

4138
public function store(TaskRequest $request) : JsonResponse

resources/views/print/tasks/parts/form.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
@method('PUT')
44
@csrf
55
@endif
6+
@if ($part)
7+
{!! \App\Helpers\FilenamePlaceholderHelper::generateWithWrapper($task, $part) !!}
8+
@endif
69
<div class="mb-3">
710
@if(empty($part))
811
<label class="form-label">{{ __('common.model') }}</label>

0 commit comments

Comments
 (0)