Removed all controller and view files related to Colors, Filaments, Filament Types, and Manufacturers.
This commit is contained in:
@@ -27,19 +27,21 @@ class Filament extends Component
|
||||
public $type_id = '';
|
||||
public $manufacturer_id = '';
|
||||
public $weight = '1000';
|
||||
public $finish = 'Basic';
|
||||
public $price = '0';
|
||||
public $stock = '0';
|
||||
|
||||
|
||||
public $search = '';
|
||||
|
||||
public $editid = '';
|
||||
public $deleteid = '';
|
||||
|
||||
|
||||
public function create() {
|
||||
@Auth::check();
|
||||
|
||||
// Validate
|
||||
$this->validate();
|
||||
$this->validate();
|
||||
|
||||
$filament = new Model();
|
||||
$filament->name = $this->name;
|
||||
@@ -47,8 +49,9 @@ class Filament extends Component
|
||||
$filament->diameter = $this->diameter;
|
||||
$filament->color_id = $this->color_id;
|
||||
$filament->filament_type_id = $this->type_id;
|
||||
$filament->manufacturer_id = $this->manufacturer_id;
|
||||
$filament->manufacturer_id = $this->manufacturer_id;
|
||||
$filament->weight = $this->weight;
|
||||
$filament->finish = $this->finish;
|
||||
$filament->price = $this->price;
|
||||
$filament->stock = $this->stock;
|
||||
$filament->save();
|
||||
@@ -75,28 +78,30 @@ class Filament extends Component
|
||||
$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();
|
||||
|
||||
|
||||
$filament = Model::findOrFail($editid);
|
||||
$filament->name = $this->name;
|
||||
$filament->description = $this->description;
|
||||
$filament->diameter = $this->diameter;
|
||||
$filament->color_id = $this->color_id;
|
||||
$filament->filament_type_id = $this->type_id;
|
||||
$filament->manufacturer_id = $this->manufacturer_id;
|
||||
$filament->manufacturer_id = $this->manufacturer_id;
|
||||
$filament->weight = $this->weight;
|
||||
$filament->finish = $this->finish;
|
||||
$filament->price = $this->price;
|
||||
$filament->stock = $this->stock;
|
||||
$filament->save();
|
||||
|
||||
$this->resetInputFields();
|
||||
|
||||
|
||||
Flux::modal('editModal')->close();
|
||||
}
|
||||
|
||||
@@ -114,6 +119,7 @@ class Filament extends Component
|
||||
$this->type_id = $filament->filament_type_id;
|
||||
$this->manufacturer_id = $filament->manufacturer_id;
|
||||
$this->weight = $filament->weight;
|
||||
$this->finish = $filament->finish;
|
||||
$this->price = $filament->price;
|
||||
$this->stock = $filament->stock;
|
||||
|
||||
@@ -136,7 +142,7 @@ class Filament extends Component
|
||||
Flux::modals()->close();
|
||||
}
|
||||
public function resetInputFields() {
|
||||
$this->reset(['name', 'description', 'diameter', 'color_id', 'type_id', 'manufacturer_id', 'weight', 'price', 'stock', 'deleteid', 'editid']);
|
||||
$this->reset(['name', 'description', 'diameter', 'color_id', 'type_id', 'manufacturer_id', 'weight', 'price', 'finish', 'deleteid', 'editid']);
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user