Renamed and reorganized Livewire components, namespaces, and views for improved file structure and clarity. Introduced filaments.show and filaments.edit routes. Updated database migrations and navigation routes accordingly. Upgraded dependencies in composer.
This commit is contained in:
@@ -63,27 +63,6 @@ class Filament extends Component
|
||||
Flux::modal('createModal')->close();
|
||||
}
|
||||
|
||||
public function edit($filamentid) {
|
||||
@Auth::check();
|
||||
|
||||
$editid = $filamentid;
|
||||
$this->editid = $editid;
|
||||
|
||||
$filament = Model::findOrFail($editid);
|
||||
|
||||
$this->name = $filament->name;
|
||||
$this->description = $filament->description;
|
||||
$this->diameter = $filament->diameter;
|
||||
$this->color_id = $filament->color_id;
|
||||
$this->type_id = $filament->filament_type_id;
|
||||
$this->manufacturer_id = $filament->manufacturer_id;
|
||||
$this->weight = $filament->weight;
|
||||
$filament->finish = $this->finish;
|
||||
$this->price = $filament->price;
|
||||
$this->stock = $filament->stock;
|
||||
|
||||
Flux::modal('editModal')->show();
|
||||
}
|
||||
public function save($editid) {
|
||||
@Auth::check();
|
||||
|
||||
@@ -144,9 +123,18 @@ class Filament extends Component
|
||||
public function resetInputFields() {
|
||||
$this->reset(['name', 'description', 'diameter', 'color_id', 'type_id', 'manufacturer_id', 'weight', 'price', 'finish', 'deleteid', 'editid']);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return redirect()->route('filaments.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('filaments.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.filament.filament', [
|
||||
return view('livewire.filament.index', [
|
||||
'filaments' => Model::search('name', $this->search)->paginate(50),
|
||||
'colors' => Color::all(),
|
||||
'manufacturers' => Manufacturer::all(),
|
||||
|
||||
Reference in New Issue
Block a user