Beispiel #1
0
Route::get('/{page}/{q}/{resultsPerPage?}', 'HomeController@searchResult');
// Clic sur un lien sortant
Route::model('crawledContent', 'CrawledContent');
Route::get('/out/{q}/{crawledContent}', 'HomeController@goOut');
Route::get('/delete/{crawledContent}', 'HomeController@delete');
Route::get('/delete/confirm/{crawledContent}', 'HomeController@deleteConfirm');
// Ajout manuel d'une URL
Route::post('/add-url', 'HomeController@addUrl')->before('csrf');
Route::get('/error/wrong-token', 'BaseController@wrongToken');
// Résultats les plus populaires
Route::get('/most-popular/{page}/{resultsPerPage?}', 'HomeController@mostPopular');
// Résultats des précédentes recherches
Route::get('/history/{page}/{resultsPerPage?}', 'HomeController@history');
// Auto-complétion
Route::post('/autocomplete', function () {
    return LogSearch::startWith(Input::get('q'));
});
// URLs accessibles uniquement en environement de développement
if (Config::get('app.debug')) {
    Route::get('/specs/1', 'DevController@specs');
    Route::get('/lang/csv', function () {
        return Response::download(Utils\Lang\CSV::convert());
    });
}
//// Espace membre
// Connexion
Route::get('/user/login', 'UserController@login');
Route::post('/user/login', 'UserController@tryLogin')->before('csrf');
Route::get('/user/logout', 'UserController@logout');
// Inscription
Route::get('/user/signin', 'UserController@signin');
Beispiel #2
0
 public function history($page, $resultsPerPage = null)
 {
     $data = LogSearch::mine()->paginatedData($page, $resultsPerPage, array('q' => '', 'pageUrl' => '/history/%d{keepResultsPerPage}', 'resultsPerPageUrl' => '/history/' . $page . '/%d'));
     $data['resultsGroups'] = $data['results']->groupBy(function ($element) {
         return $element->created_at->uRecentDate;
     });
     return $this->view('history', $data);
 }