2016-05-19 15:01:28 +01:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
2016-09-06 16:40:39 +01:00
|
|
|
|
| Web Routes
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
2017-02-03 21:49:49 +00:00
|
|
|
|
| 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!
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Route::group(['domain' => config('url.longurl')], function () {
|
2017-02-15 20:19:11 +00:00
|
|
|
|
Route::get('/', 'NotesController@index');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Static project page
|
2017-03-03 14:23:56 +00:00
|
|
|
|
Route::get('projects', 'StaticRoutesController@projects');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
2016-11-22 20:24:12 +00:00
|
|
|
|
//Static colophon page
|
2017-03-03 14:23:56 +00:00
|
|
|
|
Route::get('colophon', 'StaticRoutesController@colophon');
|
2016-11-22 20:24:12 +00:00
|
|
|
|
|
2016-05-19 15:01:28 +01:00
|
|
|
|
//The login routes to get authe'd for admin
|
2017-03-03 14:23:56 +00:00
|
|
|
|
Route::get('login', 'AuthController@showLogin')->name('login');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
Route::post('login', 'AuthController@login');
|
|
|
|
|
|
|
|
|
|
//Admin pages grouped for filter
|
2017-02-27 22:08:42 +00:00
|
|
|
|
Route::group([
|
|
|
|
|
'middleware' => 'myauth',
|
|
|
|
|
'namespace' => 'Admin',
|
|
|
|
|
'prefix' => 'admin',
|
|
|
|
|
], function () {
|
2017-03-03 14:56:43 +00:00
|
|
|
|
Route::get('/', 'HomeController@welcome');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Articles
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::group(['prefix' => 'blog'], function () {
|
|
|
|
|
Route::get('/', 'ArticlesController@index');
|
|
|
|
|
Route::get('/create', 'ArticlesController@create');
|
|
|
|
|
Route::post('/', 'ArticlesController@store');
|
|
|
|
|
Route::get('/{id}/edit', 'ArticlesController@edit');
|
|
|
|
|
Route::put('/{id}', 'ArticlesController@update');
|
|
|
|
|
Route::delete('/{id}', 'ArticlesController@destroy');
|
2017-02-27 22:08:42 +00:00
|
|
|
|
});
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Notes
|
2017-03-02 18:15:44 +00:00
|
|
|
|
Route::group(['prefix' => 'notes'], function () {
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::get('/', 'NotesController@index');
|
|
|
|
|
Route::get('/create', 'NotesController@create');
|
|
|
|
|
Route::post('/', 'NotesController@store');
|
|
|
|
|
Route::get('/{id}/edit', 'NotesController@edit');
|
|
|
|
|
Route::put('/{id}', 'NotesController@update');
|
|
|
|
|
Route::delete('/{id}', 'NotesController@destroy');
|
2017-02-27 22:08:42 +00:00
|
|
|
|
});
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Micropub Clients
|
2017-02-27 22:08:42 +00:00
|
|
|
|
Route::group(['prefix' => 'clients'], function () {
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::get('/', 'ClientsController@index');
|
|
|
|
|
Route::get('/create', 'ClientsController@create');
|
|
|
|
|
Route::post('/', 'ClientsController@store');
|
2017-03-03 13:30:49 +00:00
|
|
|
|
Route::get('/{id}/edit', 'ClientsController@edit');
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::put('/{id}', 'ClientsController@update');
|
|
|
|
|
Route::delete('/{id}', 'ClientsController@destroy');
|
2017-02-27 22:08:42 +00:00
|
|
|
|
});
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Contacts
|
2017-02-27 22:08:42 +00:00
|
|
|
|
Route::group(['prefix' => 'contacts'], function () {
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::get('/', 'ContactsController@index');
|
|
|
|
|
Route::get('/create', 'ContactsController@create');
|
|
|
|
|
Route::post('/', 'ContactsController@store');
|
2017-03-03 13:30:49 +00:00
|
|
|
|
Route::get('/{id}/edit', 'ContactsController@edit');
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::put('/{id}', 'ContactsController@update');
|
|
|
|
|
Route::delete('/{id}', 'ContactsController@destroy');
|
|
|
|
|
Route::get('/{id}/getavatar', 'ContactsController@getAvatar');
|
2017-02-27 22:08:42 +00:00
|
|
|
|
});
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Places
|
2017-02-27 22:08:42 +00:00
|
|
|
|
Route::group(['prefix' => 'places'], function () {
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::get('/', 'PlacesController@index');
|
|
|
|
|
Route::get('/create', 'PlacesController@create');
|
|
|
|
|
Route::post('/', 'PlacesController@store');
|
2017-03-03 13:30:49 +00:00
|
|
|
|
Route::get('/{id}/edit', 'PlacesController@edit');
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::put('/{id}', 'PlacesController@update');
|
2017-05-28 22:45:14 +01:00
|
|
|
|
Route::get('/{id}/merge', 'PlacesController@mergeIndex');
|
|
|
|
|
Route::get('/{place1_id}/merge/{place2_id}', 'PlacesController@mergeEdit');
|
|
|
|
|
Route::post('/merge', 'PlacesController@mergeStore');
|
2017-03-03 13:22:21 +00:00
|
|
|
|
Route::delete('/{id}', 'PlacesController@destroy');
|
2017-02-27 22:08:42 +00:00
|
|
|
|
});
|
2016-05-19 15:01:28 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Blog pages using ArticlesController
|
|
|
|
|
Route::get('blog/s/{id}', 'ArticlesController@onlyIdInURL');
|
2017-02-15 18:34:47 +00:00
|
|
|
|
Route::get('blog/{year?}/{month?}', 'ArticlesController@index');
|
|
|
|
|
Route::get('blog/{year}/{month}/{slug}', 'ArticlesController@show');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Notes pages using NotesController
|
2017-02-15 18:39:39 +00:00
|
|
|
|
Route::get('notes', 'NotesController@index');
|
|
|
|
|
Route::get('notes/{id}', 'NotesController@show');
|
|
|
|
|
Route::get('note/{id}', 'NotesController@redirect');
|
|
|
|
|
Route::get('notes/tagged/{tag}', 'NotesController@tagged');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
2017-05-18 15:15:53 +01:00
|
|
|
|
// IndieAuth
|
2017-03-01 20:59:09 +00:00
|
|
|
|
Route::post('indieauth/start', 'IndieAuthController@start')->name('indieauth-start');
|
2017-02-16 15:35:25 +00:00
|
|
|
|
Route::get('indieauth/callback', 'IndieAuthController@callback')->name('indieauth-callback');
|
|
|
|
|
Route::get('logout', 'IndieAuthController@logout')->name('indieauth-logout');
|
2017-05-18 15:15:53 +01:00
|
|
|
|
|
|
|
|
|
// Token Endpoint
|
|
|
|
|
Route::post('api/token', 'TokenEndpointController@create');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
2017-02-16 15:35:25 +00:00
|
|
|
|
// Micropub Client
|
2017-02-15 20:19:11 +00:00
|
|
|
|
Route::get('micropub/create', 'MicropubClientController@create')->name('micropub-client');
|
|
|
|
|
Route::post('micropub', 'MicropubClientController@store')->name('micropub-client-post');
|
2017-03-13 16:18:15 +00:00
|
|
|
|
Route::get('micropub/config', 'MicropubClientController@config')->name('micropub-config');
|
2017-04-21 16:38:39 +01:00
|
|
|
|
Route::get('micropub/get-new-token', 'MicropubClientController@getNewToken')->name('micropub-client-get-new-token');
|
|
|
|
|
Route::get('micropub/get-new-token/callback', 'MicropubClientController@getNewTokenCallback')->name('micropub-client-get-new-token-callback');
|
2017-03-15 12:22:41 +00:00
|
|
|
|
Route::get('micropub/query-endpoint', 'MicropubClientController@queryEndpoint')->name('micropub-query-action');
|
2017-04-21 16:38:39 +01:00
|
|
|
|
Route::post('micropub/update-syntax', 'MicropubClientController@updateSyntax')->name('micropub-update-syntax');
|
2017-02-16 15:35:25 +00:00
|
|
|
|
Route::get('micropub/places', 'MicropubClientController@nearbyPlaces');
|
|
|
|
|
Route::post('micropub/places', 'MicropubClientController@newPlace');
|
2017-03-15 12:22:41 +00:00
|
|
|
|
Route::post('micropub/media', 'MicropubClientController@processMedia')->name('process-media');
|
|
|
|
|
Route::get('micropub/media/clearlinks', 'MicropubClientController@clearLinks');
|
2017-02-16 15:35:25 +00:00
|
|
|
|
|
2017-05-18 15:15:53 +01:00
|
|
|
|
// Micropub Endpoints
|
2017-03-24 15:40:36 +00:00
|
|
|
|
Route::get('api/post', 'MicropubController@get')->middleware('micropub.token');
|
|
|
|
|
Route::post('api/post', 'MicropubController@post')->middleware('micropub.token');
|
|
|
|
|
Route::post('api/media', 'MicropubController@media')->middleware('micropub.token')->name('media-endpoint');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//webmention
|
2017-03-03 14:23:56 +00:00
|
|
|
|
Route::get('webmention', 'WebMentionsController@get');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
Route::post('webmention', 'WebMentionsController@receive');
|
|
|
|
|
|
|
|
|
|
//Contacts
|
2017-02-15 18:41:54 +00:00
|
|
|
|
Route::get('contacts', 'ContactsController@index');
|
|
|
|
|
Route::get('contacts/{nick}', 'ContactsController@show');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
|
|
|
|
|
//Places
|
|
|
|
|
Route::get('places', 'PlacesController@index');
|
|
|
|
|
Route::get('places/{slug}', 'PlacesController@show');
|
|
|
|
|
|
|
|
|
|
Route::get('feed', 'ArticlesController@makeRSS');
|
2016-11-25 19:51:42 +00:00
|
|
|
|
|
|
|
|
|
Route::get('search', 'SearchController@search');
|
2016-05-19 15:01:28 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Short URL
|
|
|
|
|
Route::group(['domain' => config('url.shorturl')], function () {
|
|
|
|
|
Route::get('/', 'ShortURLsController@baseURL');
|
|
|
|
|
Route::get('@', 'ShortURLsController@twitter');
|
|
|
|
|
Route::get('+', 'ShortURLsController@googlePlus');
|
|
|
|
|
Route::get('α', 'ShortURLsController@appNet');
|
|
|
|
|
|
|
|
|
|
Route::get('{type}/{id}', 'ShortURLsController@expandType')->where(
|
|
|
|
|
[
|
|
|
|
|
'type' => '[bt]',
|
|
|
|
|
'id' => '[0-9A-HJ-NP-Z_a-km-z]+',
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Route::get('h/{id}', 'ShortURLsController@redirect');
|
|
|
|
|
Route::get('{id}', 'ShortURLsController@oldRedirect')->where(
|
|
|
|
|
[
|
|
|
|
|
'id' => '[0-9A-HJ-NP-Z_a-km-z]{4}',
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
});
|