Esempio n. 1
0
// return PDF::load($markdownText, 'A4', 'portrait')->show();
// }
// else
// {
// return Redirect::to('/')->with('global_error', 'You can\'t access private resources without a secret link, which can be received from creation\'s authSentryor.');
// }
// }
// return Redirect::to('/')->with('global_error', 'Sorry, chapter you are trying to reach doesn\'t exist.');
// }
// ));
//Blog scraps
Route::get('/libribook', array('as' => 'libribook', function () {
    $recent = Chapter::whereRaw('author_id = ? AND book_id = ? AND public_state = ?', array('1', '1', true))->orderBy('created_at', 'desc')->first();
    $markdownParser = new MarkdownParser();
    $markdownText = $markdownParser->transformMarkdown($recent->text);
    $chapters = Chapter::whereRaw('author_id = ? AND book_id = ? AND public_state = ?', array('1', '1', true))->orderBy('created_at', 'desc')->paginate(10);
    return View::make('allround.libribook', array('pageTitle' => 'Libri-book', 'recent' => $recent, 'recent_text' => $markdownText, 'chapters' => $chapters));
}));
//Route::group(array('https' => 'true', 'before' => 'ssl'), function() Use for SSL
//{
Route::get('user', 'UserController');
Route::get('register', 'UserController@create');
Route::post('register', array('before' => 'csrf', 'uses' => 'UserController@registerUser'));
Route::get('dashboard', array('before' => 'authSentry', 'uses' => 'UserController@dashboard'));
Route::get('profile/{nick}', array('uses' => 'UserController@profile'));
Route::get('profile_edit', array('before' => 'authSentry', 'uses' => 'UserController@edit'));
Route::put('profile_edit', array('before' => 'authSentry, csrf', 'uses' => 'UserController@editUser'));
Route::get('pass_change', array('before' => 'authSentry', 'uses' => 'UserController@passChange'));
Route::put('pass_change', array('before' => 'authSentry, csrf', 'uses' => 'UserController@passChangeAction'));
Route::get('profile/follow/{id}', array('before' => 'authSentry', 'uses' => 'UserController@follow'));
Route::get('profile/unfollow/{id}', array('before' => 'authSentry', 'uses' => 'UserController@unfollow'));