I'm using Laravel 5.8. In this blade, I have text input
that the user must populate and after that to go to other page view and value from that input must be passed on that other page view
Here is my text input
code:
<input type="text" name="delivery_time" value="">
And here is my <a>
tag for a link to another page:
<a href="{{route('manager.invoicePrint', ['id' => $restaurant->id, 'code' => $inv->id, 'delivery' => 'MINUT'])}}" class="btn btn-success btn-block font-weight-bold">Prihvati</a>
So I'm already passing that variable delivery
and its value ' MINUT'
but I need that variable to be equal to the input that the user populate.
And this is a invoicePrint
function for that other page view:
/**
* Show the form for creating a new resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function invoicePrint($id, $code, $delivery)
{
$restaurant = Restaurant::find($id);
$inv = Invoice::findOrFail($code);
if(Auth::user()->userRestaurants->first()->id != $restaurant->id){
return redirect()->back();
}
return view('website.restaurants.dashboard.invoice-print', compact('restaurant', 'inv', 'delivery'));
}
Here I'm passing delivery
variable, and in my web.php
:
Route::get('/narudzbina/{id}/{code}/{delivery}', 'RestaurantsController@invoicePrint')->middleware('auth')->name('manager.invoicePrint');
This Route
is in two Route::group
.
How can I pass input value to the variable and then that variable pass on another page view(blade)?