Esempio n. 1
0
use Route;
use Auth;
use Redirect;
use Config;
use Request;
use Markdown;
use Authenticate;
// nonoesp/authenticate
use Recipient;
/*----------------------------------------------------------------*/
/* WritingController
/*----------------------------------------------------------------*/
Route::group(['middleware' => Config::get("writing.middlewares")], function () {
    $path = Writing::path();
    //TODO: $path_admin = Writing::pathAdmin();
    if (Writing::isAvailableURI()) {
        Route::get('/@{user_twitter}', function ($user_twitter) {
            $user = User::where('twitter', '=', $user_twitter)->first();
            return view('writing::profile')->withUser($user);
        });
        Route::post('articles', 'Nonoesp\\Writing\\Controllers\\WritingController@getArticlesWithIds');
        Route::get($path, array('as' => 'blog', 'uses' => 'Nonoesp\\Writing\\Controllers\\WritingController@showHome'));
        Route::get($path . 'tag/{tag}', 'Nonoesp\\Writing\\Controllers\\WritingController@showArticleTag');
        Route::get($path . '{id}', 'Nonoesp\\Writing\\Controllers\\WritingController@showArticleWithId')->where('id', '[0-9]+');
        if (Writing::isWritingURI()) {
            // Check this is an actual article route
            Route::get($path . '{slug}', 'Nonoesp\\Writing\\Controllers\\WritingController@showArticle');
        }
        // Feed
        Route::get(Config::get('writing.feed.route'), array('as' => 'feed', 'uses' => 'Nonoesp\\Writing\\Controllers\\WritingController@getFeed'));
    }