web.php (2519B)
1 <?php 2 3 /* 4 |-------------------------------------------------------------------------- 5 | Web Routes 6 |-------------------------------------------------------------------------- 7 | 8 | Here is where you can register web routes for your application. These 9 | routes are loaded by the RouteServiceProvider within a group which 10 | contains the "web" middleware group. Now create something great! 11 | 12 */ 13 14 Route::get('/', function() { 15 if (!session()->has('user')) 16 { 17 return redirect()->route('public'); 18 } 19 else 20 { 21 return redirect()->route('home'); 22 } 23 }); 24 25 Route::get('/timeline/public', 'TimelineController@public_timeline') 26 ->name('public'); 27 28 Route::get('/timeline/home', 'TimelineController@home_timeline') 29 ->name('home') 30 ->middleware('authorize'); 31 32 Route::get('/status/{status_id}', 'StatusController@show_status') 33 ->name('status'); 34 35 Route::get('/status/{status_id}/reblog', 'StatusController@reblog_status') 36 ->name('reblog') 37 ->middleware('authorize'); 38 39 Route::get('/status/{status_id}/unreblog', 'StatusController@unreblog_status') 40 ->name('unreblog') 41 ->middleware('authorize'); 42 43 Route::get('/status/{status_id}/favourite', 'StatusController@favourite_status') 44 ->name('favourite') 45 ->middleware('authorize'); 46 47 Route::get('/status/{status_id}/unfavourite', 'StatusController@unfavourite_status') 48 ->name('unfavourite') 49 ->middleware('authorize'); 50 51 Route::get('/status/{status_id}/delete', 'StatusController@delete_status') 52 ->name('delete') 53 ->middleware('authorize'); 54 55 Route::get('/status/{status_id}/thread', 'StatusController@context') 56 ->name('thread'); 57 58 Route::post('/status', 'StatusController@post_status') 59 ->name('post_status') 60 ->middleware('authorize'); 61 62 Route::get('/notifications', 'NotificationsController@get_notifications') 63 ->name('notifications') 64 ->middleware('authorize'); 65 66 Route::get('/account/{account_id}', 'AccountController@view_account') 67 ->name('account') 68 ->middleware('authorize'); 69 70 Route::get('/account/{account_id}/follow', 'AccountController@follow_account') 71 ->name('follow') 72 ->middleware('authorize'); 73 74 Route::get('/account/{account_id}/unfollow', 'AccountController@unfollow_account') 75 ->name('unfollow') 76 ->middleware('authorize'); 77 78 Route::match(['get', 'post'], '/search', 'SearchController@search') 79 ->name('search') 80 ->middleware('authorize'); 81 82 Route::get('/login', 'LoginController@login') 83 ->name('login'); 84 85 Route::get('/callback', 'LoginController@callback');