Discount !! E-commerce App With Backend Source Code Video and Voice Chatting App Firebase Chatting App Source Code Complete Gym App BLoC State Management Source Code Complete Study App Buy Ticket Booking App Source Code Buy Travel App With Backend Source Code Complete Chat App Udemy Course Special Offer Discount !! Online Learning Course App (BLoC) Online Learning Course App (Riverpod) Online Learning Course App (Getx) Discount !! Shopping App (Provider) Cool Flutter Game Nodejs Flutter Complete App
You need to use a form to do it. In your blade create a form like below
<div>
<form method="post" action="/learn-laravel">
{{csrf_field()}}
<button class="btn-class" type="submit">View laravel tutorials</button>
<input type="hidden" value="7" name="any-name">
</form>
</div>
In your form, you need to mention the hidden field type, name and value with a input tag. Since this is a post request, the data value would be sent to the controller in your "any-name" variable.
Decleare a route like this below
Route::post('your-url', 'NameController@yourFunction');
In the route the first parameter is the same the name of your action method in the form. Second parameter the first is the controller name and last section is the function name.
Within form the method must be post method. In your controller do like this
public function yourFunction(Request $request){
$id=$request->any-name;
}
Now the variable $id would contain the value passed from laravel blade.