2
I am a beginner in the language and I am trying to learn by myself, I created a php .blade.file in order to fill two simple fields and return the calculation via Submit, after that I intend to list a history stored in SQL database but I hardly know how to recover information from INDEX file !!! So you can see that I am very lost xD...and all help and tip will be very useful in my case, even more if I am doing it the WRONG way !!! Below 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;
}
}