<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Auth::routes();

Route::group(['middleware' => ['auth', 'online']], function () {
    Route::get('/', 'Main\PagesController@index');
    Route::get('/u/{username}', 'Main\PagesController@profile');
    Route::get('/edit', 'Main\PagesController@edit_profile');
    Route::post('/user/save', 'Main\UserController@save')->name('user_save');
    Route::post('/article/public', 'Main\ArticleController@store')->name('article_store');
    Route::post('/article/destroy', 'Main\ArticleController@destroy')->name('article_destroy');
    Route::post('/article/like', 'Main\ArticleController@like')->name('article_like');
    Route::get('/friends', 'Main\PagesController@friends')->name('friends');
    Route::get('/friends/search', 'Main\FriendsController@search');
    Route::post('/friends/add', 'Main\FriendsController@addFriend');
});
