I am an obvious beginner of laravel and I am having a problem about this : Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
I don't know on what seems to be the problem.. Whenever I hit the register button, That error would show up. What would be the probable cause for this error?
AdminController.php:
<?php
class AdminController extends Basecontroller{
public function index()
{
return View::make('content.index');
}
public function registration()
{
return View::make('content.registration');
}
public function registrationSave()
{
$input= Input::all();
$rules = array('username'=>'required|unique:admin', 'name'=>'required|unique:admin', 'password'=>'required');
$validate = Validator::make($input,$rules);
if($validate->passes())
{
$password = $input['password'];
$password = Hash::make($password);
$user= new User();
$user->username=$input['username'];
$user->name=$input['name'];
$user->password=$password;
$user->save();
return Redirect::to('registration');
}
}
}
routes.php:
Route::get('/','AdminController@index');
// Admin Registration
Route::get('admin/registration','AdminController@registration');
Route::post('admin/registration','AdminController@registrationSave');
registration.blade.php:
@extends('layouts.master')
@section('content')
{{ Form::open(['url'=>'admin/registrationSave']) }}
<div>
{{ Form::label('name','Name: ') }}
{{ Form::text('name','',['placeholder'=>'Name']) }}
</div>
<div>
{{ Form::label('username','Username: ') }}
{{ Form::text('username','',['placeholder'=>'Username']) }}
</div>
<div>
{{ Form::label('password','Password: ') }}
{{ Form::password('password','',['placeholder'=>'Password']) }}
</div>
<div>
{{ Form::submit('Register') }}
</div>
{{ Form::close() }}
@endsection