Embed presentation


![• Creati controller-ul: /app/Http/Controllers/FormController
<?php namespace AppHttpControllers;
class FormController extends Controller {
public function test2()
{
return view('pages.test2');
}
public function test3()
{
if(!isset($_POST["name1"])){
$bau="Hello! Please input your name: <br/>";
}else{
$bau="Good morning <b>".$_POST["name1"]."</b><br/>";
}
return view('pages.test3')->with('bau',$bau);
}
}
?>](https://image.slidesharecdn.com/2-190422103703/75/2-hello-popescu2-in-Laravel-3-2048.jpg)
![• Editati /routes/web.php
<?php
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Route::any('test2','FormController@test2');
Route::any('test3','FormController@test3');
Route::controllers([
'auth' => 'AuthAuthController',
'password' => 'AuthPasswordController',
]);](https://image.slidesharecdn.com/2-190422103703/75/2-hello-popescu2-in-Laravel-4-2048.jpg)



The document provides instructions for creating a basic Laravel form: 1. Install Laravel Collective to add form and HTML building functionality 2. Create a FormController class with methods to display a form and handle form submission 3. Configure routes to point to the FormController methods 4. Generate views for the form and submission response, using Laravel Collective to generate form elements


![• Creati controller-ul: /app/Http/Controllers/FormController
<?php namespace AppHttpControllers;
class FormController extends Controller {
public function test2()
{
return view('pages.test2');
}
public function test3()
{
if(!isset($_POST["name1"])){
$bau="Hello! Please input your name: <br/>";
}else{
$bau="Good morning <b>".$_POST["name1"]."</b><br/>";
}
return view('pages.test3')->with('bau',$bau);
}
}
?>](https://image.slidesharecdn.com/2-190422103703/75/2-hello-popescu2-in-Laravel-3-2048.jpg)
![• Editati /routes/web.php
<?php
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Route::any('test2','FormController@test2');
Route::any('test3','FormController@test3');
Route::controllers([
'auth' => 'AuthAuthController',
'password' => 'AuthPasswordController',
]);](https://image.slidesharecdn.com/2-190422103703/75/2-hello-popescu2-in-Laravel-4-2048.jpg)

