I'm a beginner in language and I'm trying to learn by myself, I created a .blade.php file in order to fill two simple fields and return the calculation via submit, after that I want to list a history stored in the SQL database, but I barely know how to retrieve information of the INDEX file !!! So you can realize that I'm well lost xD ... and all help and advice will be very useful in my case, especially if I'm doing it WRONG !!! Here are the files:
HTML:
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</head>
<div class='section'>
<div class='container'>
<div class='row'>
<div class='col-sm-3'>
<form method='POST'>
<input type='text' name='elemento1'>
<input typle='text' name='elemento2'><br>
<a href="calcular"><button type='submit'>Calcular</button></a><br>
<input typle='text' id='elemento2'>
<form method='POST'>
</div>
</div>
</div>
</div>
</html>
ROUTE:
<?php
Route::get('/', 'admin\DashBoardController@index');
Route::prefix('/')->group(function(){
Route::post('calcular','admin\DashboardController@calcular');
});
CONTROLLER:
<?php
namespace App\Http\Controllers\admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class DashboardController extends Controller
{
public function index(){
return view('index');
}
public function calcular(Request $requisicao){
return $_POST;
}
}