web.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use Illuminate\Support\Facades\Route;
  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. Auth::routes();
  14. Route::group(['middleware' => ['auth', 'online']], function () {
  15. Route::get('/', 'Main\PagesController@index');
  16. Route::get('/u/{username}', 'Main\PagesController@profile');
  17. Route::get('/edit', 'Main\PagesController@edit_profile');
  18. Route::post('/user/save', 'Main\UserController@save')->name('user_save');
  19. Route::post('/article/public', 'Main\ArticleController@store')->name('article_store');
  20. Route::post('/article/destroy', 'Main\ArticleController@destroy')->name('article_destroy');
  21. Route::post('/article/like', 'Main\ArticleController@like')->name('article_like');
  22. Route::get('/friends', 'Main\PagesController@friends')->name('friends');
  23. Route::get('/friends/search', 'Main\FriendsController@search');
  24. Route::post('/friends/add', 'Main\FriendsController@addFriend');
  25. });