commit ebbaf83a331395d86754f231ebf3852c31ee13e7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 16:07:16 2017 +0100 Show just a name if no known author url commit 7c3fc38a5101635efbb1659d7dc0e4e87f28977a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:55:07 2017 +0100 Update changelog commit e05876d604b2655fdd1b03fe5390c3333cd5e064 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:54:10 2017 +0100 Add a trait for testing tokens commit 1288769757e6c69fccf849a73ef53e6497953d74 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:54 2017 +0100 Add a test for the process like job commit d85a7109d51c979846b2b15d92e2b4c3978c6dc7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Sep 19 15:53:25 2017 +0100 fix typo, and allow for array of author info, or just a name commit 1fc63c6fb6c5648e31759502a011b2be0525af54 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:16 2017 +0100 Add another test for creating likes commit 487723ac41fa00a8182f5bf3665ab7b5f8fece52 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:38:03 2017 +0100 fix unexpected end of file error commit a24eef82ae7a2a3e1d3943a6cfed85757c713434 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 15:37:31 2017 +0100 Better response when creating likes commit fa49df98613b136167dc093a97745eeb90a4a7a6 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:39 2017 +0100 Make the author fields nullable commit 5a2f9273c18cf31a54eb54f40732024159c3dc2d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:43:20 2017 +0100 Delegate to the LikeService for creating likes commit 801d6567ec3456cbcdfa6260339dd9ed2fdfa5b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:54 2017 +0100 Create the Job that gets the content of the like and the author info commit df563473606b43a330c4e977b230d4b7b2a85268 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:28 2017 +0100 Create the service the mpub controller delegates to commit ab6ebee71ffdeb584bbef0454874d3fc1c6499f4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:42:08 2017 +0100 Allow Like::create to work for just the url commit 6d70c43f11056597a493f863c3a1ac681ed06b71 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:20 2017 +0100 Add some initial tests commit 4049342b061594656dbf7183d7428f95ba6b3598 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:10:06 2017 +0100 Add database migration/seed/factory commit 5b3aa20fa14202e84af310477b97044723201ea7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:09:21 2017 +0100 Add domain logic for likes commit 7ef5392a1833df6cee77ecb1166af4fc0abc0eb5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Sep 18 14:08:47 2017 +0100 Add routes for likes
180 lines
7.6 KiB
PHP
180 lines
7.6 KiB
PHP
<?php
|
||
|
||
/*
|
||
|--------------------------------------------------------------------------
|
||
| Web Routes
|
||
|--------------------------------------------------------------------------
|
||
|
|
||
| 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!
|
||
|
|
||
*/
|
||
|
||
Route::group(['domain' => config('url.longurl')], function () {
|
||
Route::get('/', 'NotesController@index');
|
||
|
||
//Static project page
|
||
Route::view('projects', 'projects');
|
||
|
||
//Static colophon page
|
||
Route::view('colophon', 'colophon');
|
||
|
||
//The login routes to get authe'd for admin
|
||
Route::get('login', 'AuthController@showLogin')->name('login');
|
||
Route::post('login', 'AuthController@login');
|
||
|
||
//Admin pages grouped for filter
|
||
Route::group([
|
||
'middleware' => 'myauth',
|
||
'namespace' => 'Admin',
|
||
'prefix' => 'admin',
|
||
], function () {
|
||
Route::get('/', 'HomeController@welcome');
|
||
|
||
//Articles
|
||
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');
|
||
});
|
||
|
||
//Notes
|
||
Route::group(['prefix' => 'notes'], function () {
|
||
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');
|
||
});
|
||
|
||
//Micropub Clients
|
||
Route::group(['prefix' => 'clients'], function () {
|
||
Route::get('/', 'ClientsController@index');
|
||
Route::get('/create', 'ClientsController@create');
|
||
Route::post('/', 'ClientsController@store');
|
||
Route::get('/{id}/edit', 'ClientsController@edit');
|
||
Route::put('/{id}', 'ClientsController@update');
|
||
Route::delete('/{id}', 'ClientsController@destroy');
|
||
});
|
||
|
||
//Contacts
|
||
Route::group(['prefix' => 'contacts'], function () {
|
||
Route::get('/', 'ContactsController@index');
|
||
Route::get('/create', 'ContactsController@create');
|
||
Route::post('/', 'ContactsController@store');
|
||
Route::get('/{id}/edit', 'ContactsController@edit');
|
||
Route::put('/{id}', 'ContactsController@update');
|
||
Route::delete('/{id}', 'ContactsController@destroy');
|
||
Route::get('/{id}/getavatar', 'ContactsController@getAvatar');
|
||
});
|
||
|
||
//Places
|
||
Route::group(['prefix' => 'places'], function () {
|
||
Route::get('/', 'PlacesController@index');
|
||
Route::get('/create', 'PlacesController@create');
|
||
Route::post('/', 'PlacesController@store');
|
||
Route::get('/{id}/edit', 'PlacesController@edit');
|
||
Route::put('/{id}', 'PlacesController@update');
|
||
Route::get('/{id}/merge', 'PlacesController@mergeIndex');
|
||
Route::get('/{place1_id}/merge/{place2_id}', 'PlacesController@mergeEdit');
|
||
Route::post('/merge', 'PlacesController@mergeStore');
|
||
Route::delete('/{id}', 'PlacesController@destroy');
|
||
});
|
||
});
|
||
|
||
//Blog pages using ArticlesController
|
||
Route::group(['prefix' => 'blog'], function () {
|
||
Route::get('/feed.rss', 'FeedsController@blogRss');
|
||
Route::get('/feed.atom', 'FeedsController@blogAtom');
|
||
Route::get('/feed.json', 'FeedsController@blogJson');
|
||
Route::get('/s/{id}', 'ArticlesController@onlyIdInURL');
|
||
Route::get('/{year?}/{month?}', 'ArticlesController@index');
|
||
Route::get('/{year}/{month}/{slug}', 'ArticlesController@show');
|
||
});
|
||
|
||
//Notes pages using NotesController
|
||
Route::group(['prefix' => 'notes'], function () {
|
||
Route::get('/', 'NotesController@index');
|
||
Route::get('/feed.rss', 'FeedsController@notesRss');
|
||
Route::get('/feed.atom', 'FeedsController@notesAtom');
|
||
Route::get('/feed.json', 'FeedsController@notesJson');
|
||
Route::get('/{id}', 'NotesController@show');
|
||
Route::get('/tagged/{tag}', 'NotesController@tagged');
|
||
});
|
||
Route::get('note/{id}', 'NotesController@redirect'); // for legacy note URLs
|
||
|
||
// Likes
|
||
Route::group(['prefix' => 'likes'], function () {
|
||
Route::get('/', 'LikesController@index');
|
||
Route::get('/{like}', 'LikesController@show');
|
||
});
|
||
|
||
// Micropub Client
|
||
Route::group(['prefix' => 'micropub'], function () {
|
||
Route::get('/create', 'MicropubClientController@create')->name('micropub-client');
|
||
Route::post('/', 'MicropubClientController@store')->name('micropub-client-post');
|
||
Route::get('/config', 'MicropubClientController@config')->name('micropub-config');
|
||
Route::get('/get-new-token', 'MicropubClientController@getNewToken')->name('micropub-client-get-new-token');
|
||
Route::get('/get-new-token/callback', 'MicropubClientController@getNewTokenCallback')->name('micropub-client-get-new-token-callback');
|
||
Route::get('/query-endpoint', 'MicropubClientController@queryEndpoint')->name('micropub-query-action');
|
||
Route::post('/update-syntax', 'MicropubClientController@updateSyntax')->name('micropub-update-syntax');
|
||
Route::get('/places', 'MicropubClientController@nearbyPlaces');
|
||
Route::post('/places', 'MicropubClientController@newPlace');
|
||
Route::post('/media', 'MicropubClientController@processMedia')->name('process-media');
|
||
Route::get('/media/clearlinks', 'MicropubClientController@clearLinks');
|
||
});
|
||
|
||
// IndieAuth
|
||
Route::post('indieauth/start', 'IndieAuthController@start')->name('indieauth-start');
|
||
Route::get('indieauth/callback', 'IndieAuthController@callback')->name('indieauth-callback');
|
||
Route::get('logout', 'IndieAuthController@logout')->name('indieauth-logout');
|
||
|
||
// Token Endpoint
|
||
Route::post('api/token', 'TokenEndpointController@create');
|
||
|
||
// Micropub Endpoints
|
||
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');
|
||
|
||
//webmention
|
||
Route::get('webmention', 'WebMentionsController@get');
|
||
Route::post('webmention', 'WebMentionsController@receive');
|
||
|
||
//Contacts
|
||
Route::get('contacts', 'ContactsController@index');
|
||
Route::get('contacts/{nick}', 'ContactsController@show');
|
||
|
||
//Places
|
||
Route::get('places', 'PlacesController@index');
|
||
Route::get('places/{slug}', 'PlacesController@show');
|
||
|
||
Route::get('search', 'SearchController@search');
|
||
});
|
||
|
||
//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}',
|
||
]
|
||
);
|
||
});
|