Controller:
public function store(Request $request, $machineSlotId)
{
//$machineSlots = MachineSlot::where('machine_address_id', $machineSlotId)->paginate(5);
$machineSlots = $this->getMachineSlotData1($machineSlotId);
$products = $this->getProductsData();
$store_id = Machine::where([Machine::COLUMN_MACHINE_ADDRESS_ID => $machineSlotId])->first(['store_id'])->store_id;
//create new record
MachineSlot::create($request->all());
//display text
Session::flash('success', "Table has been updated.");
//display return
//return view('machine-slots', compact('machineSlotId', 'machineSlots', 'products', 'store_id'));
return redirect()->route('machine-slots.index')->with(compact('machineSlotId', 'machineSlots', 'products', 'store_id'));
}
web:
Route::get('/machine-slots', [App\Http\Controllers\UI\MachineSlotController::class, 'index'])->name('machine-slots.index');