I have a controller which saves my form data and after saving that data i am trying to redirect my page to another form.But Redirection part not working form me. This is my saving controller code.
class CompanyRegistrationController extends BaseController
{
public function saveAndCreateCompany()
{
// my code which gets form data and saves in database.
//After that i am trying to redirect this to another page.
To acheive this i am trying to do this.
App::make('AddMoreEmployeeController')->showAddMoreEmployeeDetails();
}
}
// My new page code
class AddMoreEmployeeController extends BaseController
{
public function showAddMoreEmployeeDetails()
{
return View::make('company.addEmployee');
}
}
Routes.php code
Route::post('/companyCreatedSuccessfully', array('uses' => 'CompanyRegistrationController@saveAndCreateCompany','as' => 'saveAndCreateCompany'));
Route::get('/addMoreEmployeeDetails', array('uses' => 'AddMoreEmployeeController@showAddMoreEmployeeDetails','as' => 'showAddMoreEmployeeDetails'));
But after filling the form details I am not redirecting to "addMoreEmployeeDetails" .
I am still in companyCreatedSuccessfully with blank page.But After successful save data in
database i need to redirect to addMoreEmployeeDetails.
Where i did mistake?