2015-01-05 15:39
浏览 29


These are my routes:

Route::get('login',  array('as' => 'login', 'uses' => 'SessionController@create'));
Route::get('logout', array('as' => 'logout', 'uses' => 'SessionController@destroy'));
Route::resource('sessions', 'SessionController', array('only' => array('create', 'store', 'destroy')));

Route::get('/', array('as' => 'home', function()
    return View::make('home');

And this is my session controller:


use Latheesan\Repo\Session\SessionInterface;
use Latheesan\Service\Form\Login\LoginForm;

class SessionController extends \BaseController {

    protected $session;
    protected $loginForm;

    public function __construct(SessionInterface $session, LoginForm $loginForm)
        $this->session = $session;
        $this->loginForm = $loginForm;

     * Show the form for creating a new resource.
     * GET /sessions/create
     * @return Response
    public function create()
        return View::make('sessions.create');

     * Store a newly created resource in storage.
     * POST /sessions
     * @return Response
    public function store()
        // snipped

     * Remove the specified resource from storage.
     * DELETE /sessions
     * @return Response
    public function destroy()
        // Logout user

        // Fire user logout event

        // Success


This is the contents of SentrySession -

Now, when I go to the logout route (for e.g., it appears to be logging me out however I am not being re-directed back to home page. I just see a blank white page.

If I add something like dd('here'); after the Redirect::home(); line, I can see the word, which means the re-direction is broken/not working.

Any idea why this might be and how to fix it?

I have the error reporting (E_ALL & display_errors) turned on and laravel.log file is empty.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doujiang2643 2015-01-05 15:59

    use this: return Redirect::home();

    解决 无用
    打赏 举报

相关推荐 更多相似问题