2015-07-13 03:01:42 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Application Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register all of the routes for an application.
|
|
|
|
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
|
|
|
| and give it the controller to call when that URI is requested.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
Route::group(['prefix' => 'books'], function() {
|
|
|
|
|
|
|
|
Route::get('/', 'BookController@index');
|
|
|
|
Route::get('/create', 'BookController@create');
|
|
|
|
Route::post('/', 'BookController@store');
|
|
|
|
Route::get('/{slug}/edit', 'BookController@edit');
|
|
|
|
Route::put('/{slug}', 'BookController@update');
|
|
|
|
Route::delete('/{id}/destroy', 'BookController@destroy');
|
|
|
|
Route::get('/{slug}', 'BookController@show');
|
2015-07-13 04:31:15 +08:00
|
|
|
|
|
|
|
Route::get('/{bookSlug}/page/create', 'PageController@create');
|
|
|
|
Route::post('/{bookSlug}/page', 'PageController@store');
|
2015-07-22 03:13:29 +08:00
|
|
|
Route::get('/{bookSlug}/sort', 'PageController@sortPages');
|
|
|
|
Route::put('/{bookSlug}/sort', 'PageController@savePageSort');
|
2015-07-28 03:17:08 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/create', 'PageController@create');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
|
|
|
|
|
|
|
|
Route::get('/{bookSlug}/chapter/create', 'ChapterController@create');
|
|
|
|
Route::post('/{bookSlug}/chapter/create', 'ChapterController@store');
|
|
|
|
|
2015-07-13 03:01:42 +08:00
|
|
|
});
|
|
|
|
|
2015-07-14 04:52:56 +08:00
|
|
|
Route::post('/upload/image', 'ImageController@upload');
|
|
|
|
|
2015-07-15 05:34:31 +08:00
|
|
|
Route::get('/images/all', 'ImageController@getAll');
|
|
|
|
Route::get('/images/all/{page}', 'ImageController@getAll');
|
2015-07-14 04:52:56 +08:00
|
|
|
Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*');
|
|
|
|
|
2015-07-17 02:15:22 +08:00
|
|
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
2015-07-17 02:53:24 +08:00
|
|
|
Route::get('/pages/search/all', 'PageController@searchAll');
|
2015-07-17 02:15:22 +08:00
|
|
|
|
2015-07-13 03:01:42 +08:00
|
|
|
Route::get('/', function () {
|
|
|
|
return view('base');
|
|
|
|
});
|