commit
fcf0b4a778
163 changed files with 2959 additions and 3146 deletions
|
|
@ -5,17 +5,23 @@ root = true
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
# Unix-style newlines with a newline ending every file
|
||||||
[*]
|
[*]
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
# Tab indentation
|
# Tab indentation
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
tab_width = 4
|
tab_width = 4
|
||||||
|
|
||||||
[yml]
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[docker-compose.yml]
|
||||||
|
indent_size = 4
|
||||||
|
|
|
||||||
|
|
@ -25,22 +25,10 @@ class MigratePlaceDataFromPostgis extends Command
|
||||||
*/
|
*/
|
||||||
protected $description = 'Copy Postgis data to normal latitude longitude fields';
|
protected $description = 'Copy Postgis data to normal latitude longitude fields';
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$locationColumn = DB::selectOne(DB::raw("
|
$locationColumn = DB::selectOne(DB::raw("
|
||||||
SELECT EXISTS (
|
SELECT EXISTS (
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Models\WebMention;
|
use App\Models\WebMention;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||||
use Illuminate\FileSystem\FileSystem;
|
use Illuminate\FileSystem\FileSystem;
|
||||||
|
|
||||||
class ParseCachedWebMentions extends Command
|
class ParseCachedWebMentions extends Command
|
||||||
|
|
@ -27,9 +28,9 @@ class ParseCachedWebMentions extends Command
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @throws FileNotFoundException
|
||||||
*/
|
*/
|
||||||
public function handle(FileSystem $filesystem)
|
public function handle(FileSystem $filesystem): void
|
||||||
{
|
{
|
||||||
$htmlFiles = $filesystem->allFiles(storage_path() . '/HTML');
|
$htmlFiles = $filesystem->allFiles(storage_path() . '/HTML');
|
||||||
foreach ($htmlFiles as $file) {
|
foreach ($htmlFiles as $file) {
|
||||||
|
|
@ -49,9 +50,6 @@ class ParseCachedWebMentions extends Command
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the source URL from a filename.
|
* Determine the source URL from a filename.
|
||||||
*
|
|
||||||
* @param string
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
private function urlFromFilename(string $filepath): string
|
private function urlFromFilename(string $filepath): string
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,22 +24,10 @@ class ReDownloadWebMentions extends Command
|
||||||
*/
|
*/
|
||||||
protected $description = 'Redownload the HTML content of webmentions';
|
protected $description = 'Redownload the HTML content of webmentions';
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$webmentions = WebMention::all();
|
$webmentions = WebMention::all();
|
||||||
foreach ($webmentions as $webmention) {
|
foreach ($webmentions as $webmention) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class Kernel extends ConsoleKernel
|
||||||
/**
|
/**
|
||||||
* The Artisan commands provided by your application.
|
* The Artisan commands provided by your application.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array<int, string>
|
||||||
*/
|
*/
|
||||||
protected $commands = [
|
protected $commands = [
|
||||||
Commands\ParseCachedWebMentions::class,
|
Commands\ParseCachedWebMentions::class,
|
||||||
|
|
@ -20,22 +20,18 @@ class Kernel extends ConsoleKernel
|
||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule): void
|
||||||
{
|
{
|
||||||
$schedule->command('horizon:snapshot')->everyFiveMinutes();
|
$schedule->command('horizon:snapshot')->everyFiveMinutes();
|
||||||
|
$schedule->command('cache:prune-stale-tags')->hourly();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the commands for the application.
|
* Register the commands for the application.
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
protected function commands()
|
protected function commands(): void
|
||||||
{
|
{
|
||||||
$this->load(__DIR__ . '/Commands');
|
$this->load(__DIR__ . '/Commands');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,47 +21,34 @@ class Handler extends ExceptionHandler
|
||||||
/**
|
/**
|
||||||
* A list of the exception types that are not reported.
|
* A list of the exception types that are not reported.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array<int, class-string<\Throwable>>
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
protected $dontReport = [
|
||||||
NotFoundHttpException::class,
|
NotFoundHttpException::class,
|
||||||
ModelNotFoundException::class,
|
ModelNotFoundException::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of the inputs that are never flashed for validation exceptions.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $dontFlash = [
|
|
||||||
'password',
|
|
||||||
'password_confirmation',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||||
*
|
*
|
||||||
* @param Throwable $throwable
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function report(Throwable $throwable)
|
public function report(Throwable $e): void
|
||||||
{
|
{
|
||||||
parent::report($throwable);
|
parent::report($e);
|
||||||
|
|
||||||
if (config('logging.slack') && $this->shouldReport($throwable)) {
|
if (config('logging.slack') && $this->shouldReport($e)) {
|
||||||
$guzzle = new Client([
|
$guzzle = new Client([
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$exceptionName = get_class($throwable) ?? 'Unknown Exception';
|
$exceptionName = get_class($e) ?? 'Unknown Exception';
|
||||||
$title = $exceptionName . ': ' . $throwable->getMessage();
|
$title = $exceptionName . ': ' . $e->getMessage();
|
||||||
|
|
||||||
$guzzle->post(
|
$guzzle->post(
|
||||||
config('logging.slack'),
|
config('logging.slack'),
|
||||||
|
|
@ -89,7 +76,6 @@ class Handler extends ExceptionHandler
|
||||||
* Render an exception into an HTTP response.
|
* Render an exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Throwable $throwable
|
|
||||||
* @return Response
|
* @return Response
|
||||||
*
|
*
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ class ClientsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show a list of known clients.
|
* Show a list of known clients.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -26,8 +24,6 @@ class ClientsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form to add a client name.
|
* Show form to add a client name.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -36,8 +32,6 @@ class ClientsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to adda new client name.
|
* Process the request to adda new client name.
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(): RedirectResponse
|
public function store(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -51,9 +45,6 @@ class ClientsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to edit a client name.
|
* Show a form to edit a client name.
|
||||||
*
|
|
||||||
* @param int $clientId
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function edit(int $clientId): View
|
public function edit(int $clientId): View
|
||||||
{
|
{
|
||||||
|
|
@ -68,9 +59,6 @@ class ClientsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to edit a client name.
|
* Process the request to edit a client name.
|
||||||
*
|
|
||||||
* @param int $clientId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(int $clientId): RedirectResponse
|
public function update(int $clientId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -84,9 +72,6 @@ class ClientsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to delete a client.
|
* Process a request to delete a client.
|
||||||
*
|
|
||||||
* @param int $clientId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function destroy(int $clientId): RedirectResponse
|
public function destroy(int $clientId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ class ContactsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List the currect contacts that can be edited.
|
* List the currect contacts that can be edited.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -29,8 +27,6 @@ class ContactsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the form to add a new contact.
|
* Display the form to add a new contact.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -39,8 +35,6 @@ class ContactsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to add a new contact.
|
* Process the request to add a new contact.
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(): RedirectResponse
|
public function store(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -57,9 +51,6 @@ class ContactsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form to edit an existing contact.
|
* Show the form to edit an existing contact.
|
||||||
*
|
|
||||||
* @param int $contactId
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function edit(int $contactId): View
|
public function edit(int $contactId): View
|
||||||
{
|
{
|
||||||
|
|
@ -72,9 +63,6 @@ class ContactsController extends Controller
|
||||||
* Process the request to edit a contact.
|
* Process the request to edit a contact.
|
||||||
*
|
*
|
||||||
* @todo Allow saving profile pictures for people without homepages
|
* @todo Allow saving profile pictures for people without homepages
|
||||||
*
|
|
||||||
* @param int $contactId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(int $contactId): RedirectResponse
|
public function update(int $contactId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -101,9 +89,6 @@ class ContactsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to delete a contact.
|
* Process the request to delete a contact.
|
||||||
*
|
|
||||||
* @param int $contactId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function destroy(int $contactId): RedirectResponse
|
public function destroy(int $contactId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -119,7 +104,6 @@ class ContactsController extends Controller
|
||||||
* This method attempts to find the microformat marked-up profile image
|
* This method attempts to find the microformat marked-up profile image
|
||||||
* from a given homepage and save it accordingly
|
* from a given homepage and save it accordingly
|
||||||
*
|
*
|
||||||
* @param int $contactId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function getAvatar(int $contactId)
|
public function getAvatar(int $contactId)
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ class HomeController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show the homepage of the admin CP.
|
* Show the homepage of the admin CP.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function welcome(): View
|
public function welcome(): View
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ class LikesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List the likes that can be edited.
|
* List the likes that can be edited.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -26,8 +24,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form to make a new like.
|
* Show the form to make a new like.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -36,8 +32,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to make a new like.
|
* Process a request to make a new like.
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(): RedirectResponse
|
public function store(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -51,9 +45,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the form to edit a specific like.
|
* Display the form to edit a specific like.
|
||||||
*
|
|
||||||
* @param int $likeId
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function edit(int $likeId): View
|
public function edit(int $likeId): View
|
||||||
{
|
{
|
||||||
|
|
@ -67,9 +58,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to edit a like.
|
* Process a request to edit a like.
|
||||||
*
|
|
||||||
* @param int $likeId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(int $likeId): RedirectResponse
|
public function update(int $likeId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -83,9 +71,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to delete a like.
|
* Process the request to delete a like.
|
||||||
*
|
|
||||||
* @param int $likeId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function destroy(int $likeId): RedirectResponse
|
public function destroy(int $likeId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ class NotesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List the notes that can be edited.
|
* List the notes that can be edited.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -30,8 +28,6 @@ class NotesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form to make a new note.
|
* Show the form to make a new note.
|
||||||
*
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -40,9 +36,6 @@ class NotesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to make a new note.
|
* Process a request to make a new note.
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(Request $request): RedirectResponse
|
public function store(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -56,9 +49,6 @@ class NotesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the form to edit a specific note.
|
* Display the form to edit a specific note.
|
||||||
*
|
|
||||||
* @param int $noteId
|
|
||||||
* @return \Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function edit(int $noteId): View
|
public function edit(int $noteId): View
|
||||||
{
|
{
|
||||||
|
|
@ -71,9 +61,6 @@ class NotesController extends Controller
|
||||||
/**
|
/**
|
||||||
* Process a request to edit a note. Easy since this can only be done
|
* Process a request to edit a note. Easy since this can only be done
|
||||||
* from the admin CP.
|
* from the admin CP.
|
||||||
*
|
|
||||||
* @param int $noteId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(int $noteId): RedirectResponse
|
public function update(int $noteId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -92,9 +79,6 @@ class NotesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the note.
|
* Delete the note.
|
||||||
*
|
|
||||||
* @param int $noteId
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function destroy(int $noteId): RedirectResponse
|
public function destroy(int $noteId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the places that can be edited.
|
* List the places that can be edited.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -33,8 +31,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form to make a new place.
|
* Show the form to make a new place.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -43,8 +39,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to make a new place.
|
* Process a request to make a new place.
|
||||||
*
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(): RedirectResponse
|
public function store(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -62,9 +56,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the form to edit a specific place.
|
* Display the form to edit a specific place.
|
||||||
*
|
|
||||||
* @param int $placeId
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function edit(int $placeId): View
|
public function edit(int $placeId): View
|
||||||
{
|
{
|
||||||
|
|
@ -75,9 +66,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to edit a place.
|
* Process a request to edit a place.
|
||||||
*
|
|
||||||
* @param int $placeId
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(int $placeId): RedirectResponse
|
public function update(int $placeId): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -94,9 +82,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the places we can merge with the current place.
|
* List the places we can merge with the current place.
|
||||||
*
|
|
||||||
* @param int $placeId
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function mergeIndex(int $placeId): View
|
public function mergeIndex(int $placeId): View
|
||||||
{
|
{
|
||||||
|
|
@ -114,10 +99,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form for merging two specific places.
|
* Show a form for merging two specific places.
|
||||||
*
|
|
||||||
* @param int $placeId1
|
|
||||||
* @param int $placeId2
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function mergeEdit(int $placeId1, int $placeId2): View
|
public function mergeEdit(int $placeId1, int $placeId2): View
|
||||||
{
|
{
|
||||||
|
|
@ -129,8 +110,6 @@ class PlacesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to merge two places.
|
* Process the request to merge two places.
|
||||||
*
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function mergeStore(): RedirectResponse
|
public function mergeStore(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ class SyndicationTargetsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show a list of known syndication targets.
|
* Show a list of known syndication targets.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -26,8 +24,6 @@ class SyndicationTargetsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form to add a syndication target.
|
* Show form to add a syndication target.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function create(): View
|
public function create(): View
|
||||||
{
|
{
|
||||||
|
|
@ -36,9 +32,6 @@ class SyndicationTargetsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to adda new syndication target.
|
* Process the request to adda new syndication target.
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(Request $request): RedirectResponse
|
public function store(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -60,9 +53,6 @@ class SyndicationTargetsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to edit a syndication target.
|
* Show a form to edit a syndication target.
|
||||||
*
|
|
||||||
* @param SyndicationTarget $syndicationTarget
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function edit(SyndicationTarget $syndicationTarget): View
|
public function edit(SyndicationTarget $syndicationTarget): View
|
||||||
{
|
{
|
||||||
|
|
@ -73,10 +63,6 @@ class SyndicationTargetsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the request to edit a client name.
|
* Process the request to edit a client name.
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @param SyndicationTarget $syndicationTarget
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, SyndicationTarget $syndicationTarget): RedirectResponse
|
public function update(Request $request, SyndicationTarget $syndicationTarget): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
@ -98,9 +84,6 @@ class SyndicationTargetsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a request to delete a client.
|
* Process a request to delete a client.
|
||||||
*
|
|
||||||
* @param SyndicationTarget $syndicationTarget
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function destroy(SyndicationTarget $syndicationTarget): RedirectResponse
|
public function destroy(SyndicationTarget $syndicationTarget): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@ class ArticlesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show all articles (with pagination).
|
* Show all articles (with pagination).
|
||||||
*
|
|
||||||
* @param int|null $year
|
|
||||||
* @param int|null $month
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(int $year = null, int $month = null): View
|
public function index(int $year = null, int $month = null): View
|
||||||
{
|
{
|
||||||
|
|
@ -31,13 +27,8 @@ class ArticlesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a single article.
|
* Show a single article.
|
||||||
*
|
|
||||||
* @param int $year
|
|
||||||
* @param int $month
|
|
||||||
* @param string $slug
|
|
||||||
* @return RedirectResponse|View
|
|
||||||
*/
|
*/
|
||||||
public function show(int $year, int $month, string $slug)
|
public function show(int $year, int $month, string $slug): RedirectResponse|View
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$article = Article::where('titleurl', $slug)->firstOrFail();
|
$article = Article::where('titleurl', $slug)->firstOrFail();
|
||||||
|
|
@ -56,11 +47,7 @@ class ArticlesController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We only have the ID, work out post title, year and month
|
* We only have the ID, work out post title, year and month and redirect to it.
|
||||||
* and redirect to it.
|
|
||||||
*
|
|
||||||
* @param string $idFromUrl
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function onlyIdInUrl(string $idFromUrl): RedirectResponse
|
public function onlyIdInUrl(string $idFromUrl): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
|
@ -12,10 +13,8 @@ class AuthController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show the login form.
|
* Show the login form.
|
||||||
*
|
|
||||||
* @return View|RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function showLogin()
|
public function showLogin(): View|RedirectResponse
|
||||||
{
|
{
|
||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
|
|
@ -25,14 +24,11 @@ class AuthController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log in a user, set a session variable, check credentials against
|
* Log in a user, set a session variable, check credentials against the `.env` file.
|
||||||
* the .env file.
|
|
||||||
*
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function login(): RedirectResponse
|
public function login(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$credentials = request()->only('name', 'password');
|
$credentials = $request->only('name', 'password');
|
||||||
|
|
||||||
if (Auth::attempt($credentials, true)) {
|
if (Auth::attempt($credentials, true)) {
|
||||||
return redirect()->intended('/');
|
return redirect()->intended('/');
|
||||||
|
|
@ -42,11 +38,9 @@ class AuthController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form to logout a user.
|
* Show the form to allow a user to log-out.
|
||||||
*
|
|
||||||
* @return View|RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function showLogout()
|
public function showLogout(): View|RedirectResponse
|
||||||
{
|
{
|
||||||
if (Auth::check() === false) {
|
if (Auth::check() === false) {
|
||||||
// The user is not logged in, just redirect them home
|
// The user is not logged in, just redirect them home
|
||||||
|
|
@ -58,8 +52,6 @@ class AuthController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log the user out from their current session.
|
* Log the user out from their current session.
|
||||||
*
|
|
||||||
* @return RedirectResponse;
|
|
||||||
*/
|
*/
|
||||||
public function logout(): RedirectResponse
|
public function logout(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ class BookmarksController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show the most recent bookmarks.
|
* Show the most recent bookmarks.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -23,9 +21,6 @@ class BookmarksController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a single bookmark.
|
* Show a single bookmark.
|
||||||
*
|
|
||||||
* @param Bookmark $bookmark
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function show(Bookmark $bookmark): View
|
public function show(Bookmark $bookmark): View
|
||||||
{
|
{
|
||||||
|
|
@ -36,9 +31,6 @@ class BookmarksController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show bookmarks tagged with a specific tag.
|
* Show bookmarks tagged with a specific tag.
|
||||||
*
|
|
||||||
* @param string $tag
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function tagged(string $tag): View
|
public function tagged(string $tag): View
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ class ContactsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show all the contacts.
|
* Show all the contacts.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -33,9 +31,6 @@ class ContactsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a single contact.
|
* Show a single contact.
|
||||||
*
|
|
||||||
* @param Contact $contact
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function show(Contact $contact): View
|
public function show(Contact $contact): View
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@ class FeedsController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns the blog RSS feed.
|
* Returns the blog RSS feed.
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
*/
|
||||||
public function blogRss(): Response
|
public function blogRss(): Response
|
||||||
{
|
{
|
||||||
|
|
@ -28,8 +26,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the blog Atom feed.
|
* Returns the blog Atom feed.
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
*/
|
||||||
public function blogAtom(): Response
|
public function blogAtom(): Response
|
||||||
{
|
{
|
||||||
|
|
@ -42,8 +38,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the notes RSS feed.
|
* Returns the notes RSS feed.
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
*/
|
||||||
public function notesRss(): Response
|
public function notesRss(): Response
|
||||||
{
|
{
|
||||||
|
|
@ -57,8 +51,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the notes Atom feed.
|
* Returns the notes Atom feed.
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
*/
|
||||||
public function notesAtom(): Response
|
public function notesAtom(): Response
|
||||||
{
|
{
|
||||||
|
|
@ -73,8 +65,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the blog JSON feed.
|
* Returns the blog JSON feed.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function blogJson(): array
|
public function blogJson(): array
|
||||||
{
|
{
|
||||||
|
|
@ -106,10 +96,8 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the notes JSON feed.
|
* Returns the notes JSON feed.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function notesJson()
|
public function notesJson(): array
|
||||||
{
|
{
|
||||||
$notes = Note::latest()->with('media')->take(20)->get();
|
$notes = Note::latest()->with('media')->take(20)->get();
|
||||||
$data = [
|
$data = [
|
||||||
|
|
@ -138,8 +126,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the blog JF2 feed.
|
* Returns the blog JF2 feed.
|
||||||
*
|
|
||||||
* @return JsonResponse
|
|
||||||
*/
|
*/
|
||||||
public function blogJf2(): JsonResponse
|
public function blogJf2(): JsonResponse
|
||||||
{
|
{
|
||||||
|
|
@ -176,8 +162,6 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the notes JF2 feed.
|
* Returns the notes JF2 feed.
|
||||||
*
|
|
||||||
* @return JsonResponse
|
|
||||||
*/
|
*/
|
||||||
public function notesJf2(): JsonResponse
|
public function notesJf2(): JsonResponse
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use App\Models\Bookmark;
|
||||||
use App\Models\Like;
|
use App\Models\Like;
|
||||||
use App\Models\Note;
|
use App\Models\Note;
|
||||||
use App\Services\ActivityStreamsService;
|
use App\Services\ActivityStreamsService;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
|
@ -14,12 +15,10 @@ class FrontPageController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show all the recent activity.
|
* Show all the recent activity.
|
||||||
*
|
|
||||||
* @return Response|View
|
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request): Response|View
|
||||||
{
|
{
|
||||||
if (request()->wantsActivityStream()) {
|
if ($request->wantsActivityStream()) {
|
||||||
return (new ActivityStreamsService())->siteOwnerResponse();
|
return (new ActivityStreamsService())->siteOwnerResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ class LikesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show the latest likes.
|
* Show the latest likes.
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
|
@ -23,9 +21,6 @@ class LikesController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a single like.
|
* Show a single like.
|
||||||
*
|
|
||||||
* @param Like $like
|
|
||||||
* @return View
|
|
||||||
*/
|
*/
|
||||||
public function show(Like $like): View
|
public function show(Like $like): View
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue