Add Calculationpresets and Calculator modules with CRUD functionality, migrations, and UI components.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculationpreset;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Calculationpreset')]
|
||||
class Calculationpreset extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $calculationpreset ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('calculationpresets.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('calculationpresets.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('calculationpresets.edit', $id);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calculationpreset.index', [
|
||||
'calculationpresets' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user