我正在創建一個網站,用戶可以在其中啓動之前進行註冊。但是,當具有特定電子郵件地址的人登記時,他們已經可以訪問整個網站,其他人則被列入等待名單。Laravel 5.1 - 在每個頁面上重定向特定用戶
因此,讓我們假設每個使用Gmail地址的人都可以訪問,並且我希望其他人可以重定向到頁面/等待列表。
實施例:
Gmail使用者:
Route::get('favorites', '[email protected]');
Hotmail的用戶:
Route::get('favorites', '[email protected]')
- >讓這個重定向到
Route::get('waitlist', '[email protected]')
有一個簡單的,短的方式來爲每路線做到這一點,例如與如果,這樣的嗎?
if(substr($user->email, -9)!= "@gmail.com")
{
always redirect my routes to "Waitlist"
}
我會在你的星座,在功能上做到這一點的邏輯。 :) – ihue
如果您需要幫助,請告訴我。發佈您的登錄功能。我會幫你。 – ihue
@ihue但如果用戶手動給出的url? – Nicolas