Last active
January 31, 2016 11:39
-
-
Save Rubel-hossain/f056f7a9e2aa4b791ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment