У меня есть форма для вставки данных. После обратной передачи формы отображается другой URL-адрес формы, но страница такая же. Я думаю, что проблема возникла из-за return view('pages.booksin');, но я не знаю, как ее решить.
код контроллера ::
public function create()
{
//
return view('pages.booksin');
}
public function store(Request $request)
{
try{
$validatedInput = $request -> validate([
'sel_bookID' => 'required',
'NBilledDate' => 'required',
'NBilledNumber' => 'required',
'NBilledQuantity' => 'required',
'NBilledPrice' => 'required'
]);
$ordered_books = new OrderedBook;
$ordered_books -> BookID = $request->input('sel_bookID');
$ordered_books -> BilledNum = $request->input('NBilledNumber');
$ordered_books -> BilledDate = $request->input('NBilledDate');
$ordered_books -> Qunatity = $request->input('NBilledQuantity');
$ordered_books -> Price = $request->input('NBilledPrice');
$ordered_books -> Remarks = $request->input('NBilledRemarks');
if ($ordered_books->save())
{
Session::flash('alert-success', 'orderd successfully inserted');
}
return view('pages.booksin');
}
catch (\Exception $e) {
Session::flash('alert-danger', $e->getMessage());
return view('pages.booksin');
}
}
Путь маршрута установлен в файле web.php
Route::resource('/order','OrderedBookController');
Первоначально я открываю страницу booksin.blade.php через http://127.0.0.1:8000/order/create, но после обратной отправки показанный URL-адрес - http://127.0.0.1:8000/order. Как мне решить эту проблему? Спасибо!!!





