I am new to Laravel and I am doing the following, but I was wondering if there was a better way to do it.
Both do the same thing but return to a different view
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//Get all the services
$franchises = Franchise::all();
//Load the view and pass the services
return View::make('franchises.index')->with('franchises', $franchises);
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function indexTwo()
{
//Get all the services
$franchises = Franchise::all();
//Load the view and pass the services
return View::make('admin.usertemplate')->with('franchises', $franchises);
}
And this is my route.php
Route::get('admin/logout', array('as' => 'admin.logout', 'before' => 'user', 'uses' => 'AuthController@getLogout'));
Route::get('admin/login', array('as' => 'admin.login', 'before' => 'is_guest', 'uses' => 'AuthController@getLogin'));
Route::post('admin/login', array('as' => 'admin.login.post', 'before' => 'is_guest', 'uses' => 'AuthController@postLogin'));
//---- Backedn Index
Route::get('admin',array('as'=>'index','uses'=>'BackendController@getIndex'));