Rubel-hossain
1/31/2016 - 11:31 AM

form.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Student login</title>
</head>
<body>
	{!! Form::open(array("url"=>"insert")) !!}
		<label for="first-name">First Name</label>
		<input type="text" name="first_name" placeholder="First Name" id="first-name"></br>

		<label for="last-name">Last Name</label>
		<input type="text" name="last_name" id="last-name" placeholder="Last Name"></br>
        <p>address</p>
		<textarea name="address" id="address" cols="30" rows="10"></textarea></br>
		{!! Form::Submit('submit') !!}
	 {!!  Form::close() !!}
</body>
</html>
<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

 Route::get('form','students@get_form');

 Route::post('insert','students@store');



Route::get('test',function(){

	return view('pages.test');
});

Route::get('about',[

       'as'=>'about',
       'uses'=>'PagesController@getabout'
	]
);

Route::get('contact',function(){

	return view('pages.contact');
});

Route::get('help',function(){

	return view('pages.help');
});



/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    
 Route::get('/', function () {
    return view('welcome');
});

Route::get('first','FirstController@index');


    // Place all your web routes here...(Cut all `Route` which are define in `Route file`, paste here) 


Route::post('signup_info','FirstController@signup_info_fun');





Route::get('signup','HomeController@signup');





});
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Redirect;
use DB;

class students extends Controller
{
    
   public function get_form(){

   	  return view("students.form");
   }

   public function store(Request $data){

   	    $table = new students;
   	    $table ->first_name = $data->input('first_name');
   	    $table ->last_name = $data->input('last_name');
   	    $table ->address = $data->input('address');

   	    $table->save();
       

        return Redirect::to('form');
   }

}