Merge pull request #293 from jonnybarnes/develop
MTM Mentions Improvements
This commit is contained in:
commit
9c059f822f
129 changed files with 2079 additions and 2044 deletions
12
.github/dependabot.yml
vendored
Normal file
12
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "composer"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
68
.github/workflows/phpunit.yml
vendored
Normal file
68
.github/workflows/phpunit.yml
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
name: PHP Unit
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
phpunit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
name: PHPUnit test suite
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:latest
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: jbukdev_testing
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Node and dependencies
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- name: Setup PHP with pecl extensions
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
extensions: phpredis,imagick
|
||||||
|
|
||||||
|
- name: Copy .env
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.github', '.env');"
|
||||||
|
|
||||||
|
- name: Get Composer Cache Directory
|
||||||
|
id: composer-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Install Composer Dependencies
|
||||||
|
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
||||||
|
|
||||||
|
- name: Generate Key
|
||||||
|
run: php artisan key:generate
|
||||||
|
|
||||||
|
- name: Setup Directory Permissions
|
||||||
|
run: chmod -R 777 storage bootstrap/cache
|
||||||
|
|
||||||
|
- name: Setup Database
|
||||||
|
run: php artisan migrate
|
||||||
|
|
||||||
|
- name: Execute PHPUnit Tests
|
||||||
|
run: vendor/bin/phpunit
|
38
.github/workflows/pint.yml
vendored
Normal file
38
.github/workflows/pint.yml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
name: Laravel Pint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
name: Laravel Pint
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup PHP with pecl extensions
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
|
||||||
|
- name: Get Composer Cache Directory
|
||||||
|
id: composer-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Install Composer Dependencies
|
||||||
|
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
||||||
|
|
||||||
|
- name: Check Files with Laravel Pint
|
||||||
|
run: vendor/bin/pint --test
|
49
.github/workflows/run-tests.yml
vendored
49
.github/workflows/run-tests.yml
vendored
|
@ -1,49 +0,0 @@
|
||||||
name: Run Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
phpunit:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
name: PHPUnit test suite
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:13.4
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_DB: jbukdev_testing
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Cache node modules
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
|
|
||||||
- name: Install npm dependencies
|
|
||||||
run: npm install
|
|
||||||
- name: Setup PHP with pecl extension
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.1'
|
|
||||||
tools: phpcs
|
|
||||||
- name: Copy .env
|
|
||||||
run: php -r "file_exists('.env') || copy('.env.github', '.env');"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
|
||||||
- name: Generate key
|
|
||||||
run: php artisan key:generate
|
|
||||||
- name: Setup directory permissions
|
|
||||||
run: chmod -R 777 storage bootstrap/cache
|
|
||||||
- name: Setup test database
|
|
||||||
run: php artisan migrate
|
|
||||||
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
|
||||||
run: vendor/bin/phpunit
|
|
||||||
- name: Run phpcs
|
|
||||||
run: phpcs
|
|
17
app/CommonMark/Generators/ContactMentionGenerator.php
Normal file
17
app/CommonMark/Generators/ContactMentionGenerator.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\CommonMark\Generators;
|
||||||
|
|
||||||
|
use League\CommonMark\Extension\Mention\Generator\MentionGeneratorInterface;
|
||||||
|
use League\CommonMark\Extension\Mention\Mention;
|
||||||
|
use League\CommonMark\Node\Inline\AbstractInline;
|
||||||
|
|
||||||
|
class ContactMentionGenerator implements MentionGeneratorInterface
|
||||||
|
{
|
||||||
|
public function generateMention(Mention $mention): ?AbstractInline
|
||||||
|
{
|
||||||
|
return $mention;
|
||||||
|
}
|
||||||
|
}
|
24
app/CommonMark/Renderers/ContactMentionRenderer.php
Normal file
24
app/CommonMark/Renderers/ContactMentionRenderer.php
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\CommonMark\Renderers;
|
||||||
|
|
||||||
|
use App\Models\Contact;
|
||||||
|
use League\CommonMark\Node\Node;
|
||||||
|
use League\CommonMark\Renderer\ChildNodeRendererInterface;
|
||||||
|
use League\CommonMark\Renderer\NodeRendererInterface;
|
||||||
|
|
||||||
|
class ContactMentionRenderer implements NodeRendererInterface
|
||||||
|
{
|
||||||
|
public function render(Node $node, ChildNodeRendererInterface $childRenderer): string
|
||||||
|
{
|
||||||
|
$contact = Contact::where('nick', $node->getIdentifier())->first();
|
||||||
|
|
||||||
|
if ($contact === null) {
|
||||||
|
return '<a href="https://twitter.com/' . $node->getIdentifier() . '">@' . $node->getIdentifier() . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return trim(view('templates.mini-hcard', ['contact' => $contact])->render());
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,6 +45,7 @@ class Handler extends ExceptionHandler
|
||||||
*
|
*
|
||||||
* @param Throwable $throwable
|
* @param Throwable $throwable
|
||||||
* @return void
|
* @return void
|
||||||
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
|
@ -90,6 +91,7 @@ class Handler extends ExceptionHandler
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Throwable $throwable
|
* @param Throwable $throwable
|
||||||
* @return Response
|
* @return Response
|
||||||
|
*
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function render($request, Throwable $throwable)
|
public function render($request, Throwable $throwable)
|
||||||
|
|
|
@ -4,7 +4,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\{Article, Note};
|
use App\Models\Article;
|
||||||
|
use App\Models\Note;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@ namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Responses\MicropubResponses;
|
use App\Http\Responses\MicropubResponses;
|
||||||
use App\Models\Place;
|
use App\Models\Place;
|
||||||
use App\Services\Micropub\{HCardService, HEntryService, UpdateService};
|
use App\Services\Micropub\HCardService;
|
||||||
|
use App\Services\Micropub\HEntryService;
|
||||||
|
use App\Services\Micropub\UpdateService;
|
||||||
use App\Services\TokenService;
|
use App\Services\TokenService;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Lcobucci\JWT\Encoding\CannotDecodeContent;
|
use Lcobucci\JWT\Encoding\CannotDecodeContent;
|
||||||
|
@ -18,8 +20,11 @@ use Monolog\Logger;
|
||||||
class MicropubController extends Controller
|
class MicropubController extends Controller
|
||||||
{
|
{
|
||||||
protected TokenService $tokenService;
|
protected TokenService $tokenService;
|
||||||
|
|
||||||
protected HEntryService $hentryService;
|
protected HEntryService $hentryService;
|
||||||
|
|
||||||
protected HCardService $hcardService;
|
protected HCardService $hcardService;
|
||||||
|
|
||||||
protected UpdateService $updateService;
|
protected UpdateService $updateService;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
@ -168,6 +173,7 @@ class MicropubController extends Controller
|
||||||
* Determine the client id from the access token sent with the request.
|
* Determine the client id from the access token sent with the request.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
* @throws RequiredConstraintsViolated
|
* @throws RequiredConstraintsViolated
|
||||||
*/
|
*/
|
||||||
private function getClientId(): string
|
private function getClientId(): string
|
||||||
|
|
|
@ -97,6 +97,7 @@ class MicropubMediaController extends Controller
|
||||||
* Process a media item posted to the media endpoint.
|
* Process a media item posted to the media endpoint.
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
|
*
|
||||||
* @throws BindingResolutionException
|
* @throws BindingResolutionException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@ -231,6 +232,7 @@ class MicropubMediaController extends Controller
|
||||||
*
|
*
|
||||||
* @param UploadedFile $file
|
* @param UploadedFile $file
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function saveFile(UploadedFile $file): string
|
private function saveFile(UploadedFile $file): string
|
||||||
|
|
|
@ -40,6 +40,7 @@ class DownloadWebMention implements ShouldQueue
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
* @param Client $guzzle
|
* @param Client $guzzle
|
||||||
|
*
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
* @throws FileNotFoundException
|
* @throws FileNotFoundException
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -44,6 +44,7 @@ class ProcessLike implements ShouldQueue
|
||||||
* @param Client $client
|
* @param Client $client
|
||||||
* @param Authorship $authorship
|
* @param Authorship $authorship
|
||||||
* @return int
|
* @return int
|
||||||
|
*
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function handle(Client $client, Authorship $authorship): int
|
public function handle(Client $client, Authorship $authorship): int
|
||||||
|
|
|
@ -5,13 +5,15 @@ declare(strict_types=1);
|
||||||
namespace App\Jobs;
|
namespace App\Jobs;
|
||||||
|
|
||||||
use App\Exceptions\RemoteContentNotFoundException;
|
use App\Exceptions\RemoteContentNotFoundException;
|
||||||
use App\Models\{Note, WebMention};
|
use App\Models\Note;
|
||||||
|
use App\Models\WebMention;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Queue\{InteractsWithQueue, SerializesModels};
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Jonnybarnes\WebmentionsParser\Exceptions\InvalidMentionException;
|
use Jonnybarnes\WebmentionsParser\Exceptions\InvalidMentionException;
|
||||||
use Jonnybarnes\WebmentionsParser\Parser;
|
use Jonnybarnes\WebmentionsParser\Parser;
|
||||||
use Mf2;
|
use Mf2;
|
||||||
|
@ -45,6 +47,7 @@ class ProcessWebMention implements ShouldQueue
|
||||||
*
|
*
|
||||||
* @param Parser $parser
|
* @param Parser $parser
|
||||||
* @param Client $guzzle
|
* @param Client $guzzle
|
||||||
|
*
|
||||||
* @throws RemoteContentNotFoundException
|
* @throws RemoteContentNotFoundException
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
* @throws InvalidMentionException
|
* @throws InvalidMentionException
|
||||||
|
|
|
@ -37,6 +37,7 @@ class SyndicateBookmarkToTwitter implements ShouldQueue
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
* @param Client $guzzle
|
* @param Client $guzzle
|
||||||
|
*
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function handle(Client $guzzle)
|
public function handle(Client $guzzle)
|
||||||
|
|
|
@ -35,6 +35,7 @@ class SyndicateNoteToTwitter implements ShouldQueue
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
* @param Client $guzzle
|
* @param Client $guzzle
|
||||||
|
*
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function handle(Client $guzzle)
|
public function handle(Client $guzzle)
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use League\CommonMark\CommonMarkConverter;
|
|
||||||
use League\CommonMark\Environment\Environment;
|
use League\CommonMark\Environment\Environment;
|
||||||
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||||
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
||||||
|
|
|
@ -26,6 +26,7 @@ use Illuminate\Support\Carbon;
|
||||||
* @property-read string $longurl
|
* @property-read string $longurl
|
||||||
* @property-read Collection|Tag[] $tags
|
* @property-read Collection|Tag[] $tags
|
||||||
* @property-read int|null $tags_count
|
* @property-read int|null $tags_count
|
||||||
|
*
|
||||||
* @method static Builder|Bookmark newModelQuery()
|
* @method static Builder|Bookmark newModelQuery()
|
||||||
* @method static Builder|Bookmark newQuery()
|
* @method static Builder|Bookmark newQuery()
|
||||||
* @method static Builder|Bookmark query()
|
* @method static Builder|Bookmark query()
|
||||||
|
|
|
@ -4,10 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class Contact extends Model
|
class Contact extends Model
|
||||||
{
|
{
|
||||||
|
@ -26,4 +25,20 @@ class Contact extends Model
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['nick', 'name', 'homepage', 'twitter', 'facebook'];
|
protected $fillable = ['nick', 'name', 'homepage', 'twitter', 'facebook'];
|
||||||
|
|
||||||
|
protected function photo(): Attribute
|
||||||
|
{
|
||||||
|
$photo = '/assets/profile-images/default-image';
|
||||||
|
|
||||||
|
if (array_key_exists('homepage', $this->attributes) && ! empty($this->attributes['homepage'])) {
|
||||||
|
$host = parse_url($this->attributes['homepage'], PHP_URL_HOST);
|
||||||
|
if (file_exists(public_path() . '/assets/profile-images/' . $host . '/image')) {
|
||||||
|
$photo = '/assets/profile-images/' . $host . '/image';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Attribute::make(
|
||||||
|
get: fn () => $photo,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,9 @@ declare(strict_types=1);
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Traits\FilterHtml;
|
use App\Traits\FilterHtml;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Mf2;
|
use Mf2;
|
||||||
|
|
||||||
class Like extends Model
|
class Like extends Model
|
||||||
|
|
|
@ -4,11 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class Media extends Model
|
class Media extends Model
|
||||||
|
|
|
@ -4,12 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class MicropubClient extends Model
|
class MicropubClient extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,13 +4,20 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\CommonMark\Generators\ContactMentionGenerator;
|
||||||
|
use App\CommonMark\Renderers\ContactMentionRenderer;
|
||||||
use App\Exceptions\TwitterContentException;
|
use App\Exceptions\TwitterContentException;
|
||||||
use Barryvdh\LaravelIdeHelper\Eloquent;
|
|
||||||
use Codebird\Codebird;
|
use Codebird\Codebird;
|
||||||
use Exception;
|
use Exception;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Database\Eloquent\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany};
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\{Builder, Factories\HasFactory, Model, SoftDeletes};
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use JetBrains\PhpStorm\ArrayShape;
|
use JetBrains\PhpStorm\ArrayShape;
|
||||||
use Jonnybarnes\IndieWeb\Numbers;
|
use Jonnybarnes\IndieWeb\Numbers;
|
||||||
|
@ -19,9 +26,12 @@ use League\CommonMark\Extension\Autolink\AutolinkExtension;
|
||||||
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||||
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
||||||
use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode;
|
use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode;
|
||||||
|
use League\CommonMark\Extension\Mention\Mention;
|
||||||
|
use League\CommonMark\Extension\Mention\MentionExtension;
|
||||||
use League\CommonMark\MarkdownConverter;
|
use League\CommonMark\MarkdownConverter;
|
||||||
use Normalizer;
|
use Normalizer;
|
||||||
use Spatie\CommonMarkHighlighter\{FencedCodeRenderer, IndentedCodeRenderer};
|
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
|
||||||
|
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
|
||||||
|
|
||||||
class Note extends Model
|
class Note extends Model
|
||||||
{
|
{
|
||||||
|
@ -131,7 +141,7 @@ class Note extends Model
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
#[ArrayShape(['note' => "null|string"])]
|
#[ArrayShape(['note' => 'null|string'])]
|
||||||
public function toSearchableArray(): array
|
public function toSearchableArray(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -172,8 +182,7 @@ class Note extends Model
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hcards = $this->makeHCards($value);
|
$hashtags = $this->autoLinkHashtag($value);
|
||||||
$hashtags = $this->autoLinkHashtag($hcards);
|
|
||||||
|
|
||||||
return $this->convertMarkdown($hashtags);
|
return $this->convertMarkdown($hashtags);
|
||||||
}
|
}
|
||||||
|
@ -373,13 +382,16 @@ class Note extends Model
|
||||||
* That is we swap the contacts names for their known Twitter handles.
|
* That is we swap the contacts names for their known Twitter handles.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
* @throws TwitterContentException
|
* @throws TwitterContentException
|
||||||
*/
|
*/
|
||||||
public function getTwitterContentAttribute(): string
|
public function getTwitterContentAttribute(): string
|
||||||
{
|
{
|
||||||
|
$this->getContacts();
|
||||||
|
|
||||||
// check for contacts
|
// check for contacts
|
||||||
if ($this->contacts === null || count($this->contacts) === 0) {
|
if ($this->contacts === null || count($this->contacts) === 0) {
|
||||||
throw new TwitterContentException('There are no contacts for this note');
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// here we check the matched contact from the note corresponds to a contact
|
// here we check the matched contact from the note corresponds to a contact
|
||||||
|
@ -388,10 +400,10 @@ class Note extends Model
|
||||||
count(array_unique(array_values($this->contacts))) === 1
|
count(array_unique(array_values($this->contacts))) === 1
|
||||||
&& array_unique(array_values($this->contacts))[0] === null
|
&& array_unique(array_values($this->contacts))[0] === null
|
||||||
) {
|
) {
|
||||||
throw new TwitterContentException('The matched contact is not in the database');
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// swap in twitter usernames
|
// swap in Twitter usernames
|
||||||
$swapped = preg_replace_callback(
|
$swapped = preg_replace_callback(
|
||||||
self::USERNAMES_REGEX,
|
self::USERNAMES_REGEX,
|
||||||
function ($matches) {
|
function ($matches) {
|
||||||
|
@ -406,7 +418,7 @@ class Note extends Model
|
||||||
|
|
||||||
return $contact->name;
|
return $contact->name;
|
||||||
},
|
},
|
||||||
$this->getOriginal('note')
|
$this->getRawOriginal('note')
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->convertMarkdown($swapped);
|
return $this->convertMarkdown($swapped);
|
||||||
|
@ -527,9 +539,21 @@ class Note extends Model
|
||||||
*/
|
*/
|
||||||
private function convertMarkdown(string $note): string
|
private function convertMarkdown(string $note): string
|
||||||
{
|
{
|
||||||
$environment = new Environment();
|
$config = [
|
||||||
|
'mentions' => [
|
||||||
|
'contacts_handle' => [
|
||||||
|
'prefix' => '@',
|
||||||
|
'pattern' => '[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)',
|
||||||
|
'generator' => new ContactMentionGenerator(),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$environment = new Environment($config);
|
||||||
$environment->addExtension(new CommonMarkCoreExtension());
|
$environment->addExtension(new CommonMarkCoreExtension());
|
||||||
$environment->addExtension(new AutolinkExtension());
|
$environment->addExtension(new AutolinkExtension());
|
||||||
|
$environment->addExtension(new MentionExtension());
|
||||||
|
$environment->addRenderer(Mention::class, new ContactMentionRenderer());
|
||||||
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||||
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||||
$markdownConverter = new MarkdownConverter($environment);
|
$markdownConverter = new MarkdownConverter($environment);
|
||||||
|
|
|
@ -5,9 +5,10 @@ declare(strict_types=1);
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Cviebrock\EloquentSluggable\Sluggable;
|
use Cviebrock\EloquentSluggable\Sluggable;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class Place extends Model
|
class Place extends Model
|
||||||
|
|
|
@ -4,12 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class Tag extends Model
|
class Tag extends Model
|
||||||
|
|
|
@ -4,13 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\DatabaseNotification;
|
|
||||||
use Illuminate\Notifications\DatabaseNotificationCollection;
|
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,12 +6,10 @@ namespace App\Models;
|
||||||
|
|
||||||
use App\Traits\FilterHtml;
|
use App\Traits\FilterHtml;
|
||||||
use Codebird\Codebird;
|
use Codebird\Codebird;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Jonnybarnes\WebmentionsParser\Authorship;
|
use Jonnybarnes\WebmentionsParser\Authorship;
|
||||||
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
|
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
|
||||||
|
@ -49,6 +47,7 @@ class WebMention extends Model
|
||||||
* Get the author of the webmention.
|
* Get the author of the webmention.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
* @throws AuthorshipParserException
|
* @throws AuthorshipParserException
|
||||||
*/
|
*/
|
||||||
public function getAuthorAttribute(): array
|
public function getAuthorAttribute(): array
|
||||||
|
|
|
@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Observers;
|
namespace App\Observers;
|
||||||
|
|
||||||
use App\Models\{Note, Tag};
|
use App\Models\Note;
|
||||||
use Illuminate\Support\{Arr, Collection};
|
use App\Models\Tag;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
class NoteObserver
|
class NoteObserver
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,10 +7,12 @@ namespace App\Services;
|
||||||
use App\Exceptions\InternetArchiveException;
|
use App\Exceptions\InternetArchiveException;
|
||||||
use App\Jobs\ProcessBookmark;
|
use App\Jobs\ProcessBookmark;
|
||||||
use App\Jobs\SyndicateBookmarkToTwitter;
|
use App\Jobs\SyndicateBookmarkToTwitter;
|
||||||
use App\Models\{Bookmark, Tag};
|
use App\Models\Bookmark;
|
||||||
|
use App\Models\Tag;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Exception\ClientException;
|
use GuzzleHttp\Exception\ClientException;
|
||||||
use Illuminate\Support\{Arr, Str};
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use Ramsey\Uuid\Uuid;
|
use Ramsey\Uuid\Uuid;
|
||||||
use Spatie\Browsershot\Browsershot;
|
use Spatie\Browsershot\Browsershot;
|
||||||
use Spatie\Browsershot\Exceptions\CouldNotTakeBrowsershot;
|
use Spatie\Browsershot\Exceptions\CouldNotTakeBrowsershot;
|
||||||
|
@ -83,6 +85,7 @@ class BookmarkService
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @return string The uuid for the screenshot
|
* @return string The uuid for the screenshot
|
||||||
|
*
|
||||||
* @throws CouldNotTakeBrowsershot
|
* @throws CouldNotTakeBrowsershot
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
|
@ -106,6 +109,7 @@ class BookmarkService
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
* @throws InternetArchiveException
|
* @throws InternetArchiveException
|
||||||
*/
|
*/
|
||||||
public function getArchiveLink(string $url): string
|
public function getArchiveLink(string $url): string
|
||||||
|
|
|
@ -4,7 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Services\Micropub;
|
namespace App\Services\Micropub;
|
||||||
|
|
||||||
use App\Services\{BookmarkService, LikeService, NoteService};
|
use App\Services\BookmarkService;
|
||||||
|
use App\Services\LikeService;
|
||||||
|
use App\Services\NoteService;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
class HEntryService
|
class HEntryService
|
||||||
|
|
|
@ -4,9 +4,11 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Services\Micropub;
|
namespace App\Services\Micropub;
|
||||||
|
|
||||||
use App\Models\{Media, Note};
|
use App\Models\Media;
|
||||||
|
use App\Models\Note;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Illuminate\Support\{Arr, Str};
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class UpdateService
|
class UpdateService
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,9 +4,13 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Jobs\{SendWebMentions, SyndicateNoteToTwitter};
|
use App\Jobs\SendWebMentions;
|
||||||
use App\Models\{Media, Note, Place};
|
use App\Jobs\SyndicateNoteToTwitter;
|
||||||
use Illuminate\Support\{Arr, Str};
|
use App\Models\Media;
|
||||||
|
use App\Models\Note;
|
||||||
|
use App\Models\Place;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class NoteService
|
class NoteService
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,8 @@ namespace App\Services;
|
||||||
|
|
||||||
use App\Jobs\AddClientToDatabase;
|
use App\Jobs\AddClientToDatabase;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Lcobucci\JWT\{Configuration, Token};
|
use Lcobucci\JWT\Configuration;
|
||||||
|
use Lcobucci\JWT\Token;
|
||||||
|
|
||||||
class TokenService
|
class TokenService
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
"league/commonmark": "^2.0",
|
"league/commonmark": "^2.0",
|
||||||
"league/flysystem-aws-s3-v3": "^3.0",
|
"league/flysystem-aws-s3-v3": "^3.0",
|
||||||
"mf2/mf2": "~0.3",
|
"mf2/mf2": "~0.3",
|
||||||
"predis/predis": "~1.0",
|
|
||||||
"spatie/browsershot": "~3.0",
|
"spatie/browsershot": "~3.0",
|
||||||
"spatie/commonmark-highlighter": "^3.0",
|
"spatie/commonmark-highlighter": "^3.0",
|
||||||
"symfony/html-sanitizer": "^6.1"
|
"symfony/html-sanitizer": "^6.1"
|
||||||
|
@ -39,6 +38,7 @@
|
||||||
"beyondcode/laravel-dump-server": "^1.0",
|
"beyondcode/laravel-dump-server": "^1.0",
|
||||||
"fakerphp/faker": "^1.9.2",
|
"fakerphp/faker": "^1.9.2",
|
||||||
"laravel/dusk": "^6.0",
|
"laravel/dusk": "^6.0",
|
||||||
|
"laravel/pint": "^0.2.3",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"nunomaduro/collision": "^6.1",
|
"nunomaduro/collision": "^6.1",
|
||||||
"phpunit/php-code-coverage": "^9.2",
|
"phpunit/php-code-coverage": "^9.2",
|
||||||
|
|
597
composer.lock
generated
597
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -26,12 +26,12 @@ return array(
|
||||||
| can also be used. For PDO, run the package migrations first.
|
| can also be used. For PDO, run the package migrations first.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'storage' => array(
|
'storage' => [
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'driver' => 'file', // redis, file, pdo
|
'driver' => 'file', // redis, file, pdo
|
||||||
'path' => storage_path() . '/debugbar', // For file driver
|
'path' => storage_path() . '/debugbar', // For file driver
|
||||||
'connection' => null, // Leave null for default connection (Redis/PDO)
|
'connection' => null, // Leave null for default connection (Redis/PDO)
|
||||||
),
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -70,7 +70,7 @@ return array(
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'collectors' => array(
|
'collectors' => [
|
||||||
'phpinfo' => true, // Php version
|
'phpinfo' => true, // Php version
|
||||||
'messages' => true, // Messages
|
'messages' => true, // Messages
|
||||||
'time' => true, // Time Datalogger
|
'time' => true, // Time Datalogger
|
||||||
|
@ -90,7 +90,7 @@ return array(
|
||||||
'config' => false, // Display config settings
|
'config' => false, // Display config settings
|
||||||
'auth' => false, // Display Laravel authentication status
|
'auth' => false, // Display Laravel authentication status
|
||||||
'session' => false, // Display session data in a separate tab
|
'session' => false, // Display session data in a separate tab
|
||||||
),
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -101,33 +101,33 @@ return array(
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'options' => array(
|
'options' => [
|
||||||
'auth' => array(
|
'auth' => [
|
||||||
'show_name' => false, // Also show the users name/email in the debugbar
|
'show_name' => false, // Also show the users name/email in the debugbar
|
||||||
),
|
],
|
||||||
'db' => array(
|
'db' => [
|
||||||
'with_params' => true, // Render SQL with the parameters substituted
|
'with_params' => true, // Render SQL with the parameters substituted
|
||||||
'timeline' => false, // Add the queries to the timeline
|
'timeline' => false, // Add the queries to the timeline
|
||||||
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
|
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
|
||||||
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries
|
'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
|
'types' => ['SELECT'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
|
||||||
),
|
],
|
||||||
'hints' => true, // Show hints for common mistakes
|
'hints' => true, // Show hints for common mistakes
|
||||||
),
|
],
|
||||||
'mail' => array(
|
'mail' => [
|
||||||
'full_log' => false
|
'full_log' => false,
|
||||||
),
|
],
|
||||||
'views' => array(
|
'views' => [
|
||||||
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
||||||
),
|
],
|
||||||
'route' => array(
|
'route' => [
|
||||||
'label' => true // show complete route on bar
|
'label' => true, // show complete route on bar
|
||||||
),
|
],
|
||||||
'logs' => array(
|
'logs' => [
|
||||||
'file' => null
|
'file' => null,
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -142,4 +142,4 @@ return array(
|
||||||
|
|
||||||
'inject' => true,
|
'inject' => true,
|
||||||
|
|
||||||
);
|
];
|
||||||
|
|
|
@ -17,7 +17,6 @@ return [
|
||||||
*
|
*
|
||||||
* Defaults to null, which uses the toString() method on your model.
|
* Defaults to null, which uses the toString() method on your model.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'source' => null,
|
'source' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,7 +24,6 @@ return [
|
||||||
* no length restrictions are enforced. Set it to a positive integer if you
|
* no length restrictions are enforced. Set it to a positive integer if you
|
||||||
* want to make sure your slugs aren't too long.
|
* want to make sure your slugs aren't too long.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'maxLength' => null,
|
'maxLength' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,13 +41,11 @@ return [
|
||||||
*
|
*
|
||||||
* 'method' => array('Str','slug'),
|
* 'method' => array('Str','slug'),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'method' => null,
|
'method' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separator to use when generating slugs. Defaults to a hyphen.
|
* Separator to use when generating slugs. Defaults to a hyphen.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'separator' => '-',
|
'separator' => '-',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +57,6 @@ return [
|
||||||
* my-slug-1
|
* my-slug-1
|
||||||
* my-slug-2
|
* my-slug-2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'unique' => true,
|
'unique' => true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +67,6 @@ return [
|
||||||
* "similar" slugs. The closure should return the new unique
|
* "similar" slugs. The closure should return the new unique
|
||||||
* suffix to append to the slug.
|
* suffix to append to the slug.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'uniqueSuffix' => null,
|
'uniqueSuffix' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +75,6 @@ return [
|
||||||
* If set to "false", then a new slug could duplicate one that exists on a trashed model.
|
* If set to "false", then a new slug could duplicate one that exists on a trashed model.
|
||||||
* If set to "true", then uniqueness is enforced across trashed and existing models.
|
* If set to "true", then uniqueness is enforced across trashed and existing models.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'includeTrashed' => false,
|
'includeTrashed' => false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +100,6 @@ return [
|
||||||
*
|
*
|
||||||
* and continue from there.
|
* and continue from there.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'reserved' => null,
|
'reserved' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,7 +112,6 @@ return [
|
||||||
* is probably not a good idea from an SEO point of view.
|
* is probably not a good idea from an SEO point of view.
|
||||||
* Only set this to true if you understand the possible consequences.
|
* Only set this to true if you understand the possible consequences.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'onUpdate' => false,
|
'onUpdate' => false,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -22,5 +22,5 @@ return [
|
||||||
'photo' => 'https://pbs.twimg.com/profile_images/875422855932121089/W628ZI8w_400x400.jpg',
|
'photo' => 'https://pbs.twimg.com/profile_images/875422855932121089/W628ZI8w_400x400.jpg',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'longurl' => env('APP_LONGURL', 'jonnybarnes.uk'),
|
'longurl' => env('APP_LONGURL', 'jonnybarnes.uk'),
|
||||||
'shorturl' => env('APP_SHORTURL', 'jmb.lv')
|
'shorturl' => env('APP_SHORTURL', 'jmb.lv'),
|
||||||
];
|
];
|
||||||
|
|
|
@ -20,6 +20,7 @@ class NoteFactory extends Factory
|
||||||
* Define the model's default state.
|
* Define the model's default state.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function definition()
|
public function definition()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateArticlesTable extends Migration
|
class CreateArticlesTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateNotesTable extends Migration
|
class CreateNotesTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateTagsTable extends Migration
|
class CreateTagsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateNoteTagTable extends Migration
|
class CreateNoteTagTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateContactsTable extends Migration
|
class CreateContactsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateWebMentionsTable extends Migration
|
class CreateWebMentionsTable extends Migration
|
||||||
{
|
{
|
||||||
|
@ -12,8 +12,7 @@ class CreateWebMentionsTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('webmentions', function (Blueprint $table)
|
Schema::create('webmentions', function (Blueprint $table) {
|
||||||
{
|
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('source');
|
$table->string('source');
|
||||||
$table->string('target');
|
$table->string('target');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateClientsTable extends Migration
|
class CreateClientsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateFailedJobsTable extends Migration
|
class CreateFailedJobsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateMediaTable extends Migration
|
class CreateMediaTable extends Migration
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@ class CreateMediaTable extends Migration
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreatePlacesTable extends Migration
|
class CreatePlacesTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class AddPlaceRelationToNotes extends Migration
|
class AddPlaceRelationToNotes extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class AddJsonbMf2ColumnToWebmentionsTable extends Migration
|
class AddJsonbMf2ColumnToWebmentionsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class AddExceptionColumnToFailedJobsTable extends Migration
|
class AddExceptionColumnToFailedJobsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CascadeDeleteNoteTags extends Migration
|
class CascadeDeleteNoteTags extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddFacebookUrlColumnToNotes extends Migration
|
class AddFacebookUrlColumnToNotes extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddFacebookToContacts extends Migration
|
class AddFacebookToContacts extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class AddSearchToNotes extends Migration
|
class AddSearchToNotes extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddIconToPlaces extends Migration
|
class AddIconToPlaces extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateMediaEndpointTable extends Migration
|
class CreateMediaEndpointTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateIndieWebUsersTable extends Migration
|
class CreateIndieWebUsersTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdateNotesTableAddSwarmUrl extends Migration
|
class UpdateNotesTableAddSwarmUrl extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdatePlacesTableAddFoursquareColumn extends Migration
|
class UpdatePlacesTableAddFoursquareColumn extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdateNotesTableAddInstagramUrl extends Migration
|
class UpdateNotesTableAddInstagramUrl extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdatePlacesTableAddExternalUrls extends Migration
|
class UpdatePlacesTableAddExternalUrls extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class AllowEmptyNoteContent extends Migration
|
class AllowEmptyNoteContent extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdateMediaEndpointTableAddNullableImageWidthColumn extends Migration
|
class UpdateMediaEndpointTableAddNullableImageWidthColumn extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateLikesTable extends Migration
|
class CreateLikesTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateBookmarksTable extends Migration
|
class CreateBookmarksTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateBookmarkTagPivotTable extends Migration
|
class CreateBookmarkTagPivotTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class UpdateModelsReferenceInWebmentionsTable extends Migration
|
class UpdateModelsReferenceInWebmentionsTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateTelescopeEntriesTable extends Migration
|
class CreateTelescopeEntriesTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateUsersTable extends Migration
|
class CreateUsersTable extends Migration
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Article;
|
use App\Models\Article;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ArticlesTableSeeder extends Seeder
|
class ArticlesTableSeeder extends Seeder
|
||||||
|
@ -28,7 +28,7 @@ class ArticlesTableSeeder extends Seeder
|
||||||
->update(['updated_at' => $now->toDateTimeString()]);
|
->update(['updated_at' => $now->toDateTimeString()]);
|
||||||
|
|
||||||
$now = Carbon::now()->subHours(2)->subMinutes(25);
|
$now = Carbon::now()->subHours(2)->subMinutes(25);
|
||||||
$articleWithCode = <<<EOF
|
$articleWithCode = <<<'EOF'
|
||||||
I wrote some code.
|
I wrote some code.
|
||||||
|
|
||||||
I liked writing this:
|
I liked writing this:
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\{Bookmark, Tag};
|
use App\Models\Bookmark;
|
||||||
|
use App\Models\Tag;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class BookmarksTableSeeder extends Seeder
|
class BookmarksTableSeeder extends Seeder
|
||||||
|
|
|
@ -4,8 +4,8 @@ namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Like;
|
use App\Models\Like;
|
||||||
use Faker\Generator;
|
use Faker\Generator;
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class LikesTableSeeder extends Seeder
|
class LikesTableSeeder extends Seeder
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
use App\Models\Media;
|
||||||
|
use App\Models\Note;
|
||||||
|
use App\Models\Place;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use App\Models\{Media, Note, Place};
|
|
||||||
use SplFileInfo;
|
use SplFileInfo;
|
||||||
|
|
||||||
class NotesTableSeeder extends Seeder
|
class NotesTableSeeder extends Seeder
|
||||||
|
@ -184,7 +186,7 @@ class NotesTableSeeder extends Seeder
|
||||||
->update(['updated_at' => $now->toDateTimeString()]);
|
->update(['updated_at' => $now->toDateTimeString()]);
|
||||||
|
|
||||||
$now = Carbon::now()->subHours(2);
|
$now = Carbon::now()->subHours(2);
|
||||||
$noteWithCodeContent = <<<EOF
|
$noteWithCodeContent = <<<'EOF'
|
||||||
A note with some code:
|
A note with some code:
|
||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
|
@ -203,7 +205,7 @@ EOF;
|
||||||
$noteWithLongUrl = Note::create([
|
$noteWithLongUrl = Note::create([
|
||||||
'note' => 'Best site: https://example.org/posts/some-really-long-slug-that-is-too-wide-on-mobile',
|
'note' => 'Best site: https://example.org/posts/some-really-long-slug-that-is-too-wide-on-mobile',
|
||||||
'created_at' => $now,
|
'created_at' => $now,
|
||||||
'client_id' => 'https://beta.indigenous.abode.pub/ios/'
|
'client_id' => 'https://beta.indigenous.abode.pub/ios/',
|
||||||
]);
|
]);
|
||||||
DB::table('notes')
|
DB::table('notes')
|
||||||
->where('id', $noteWithLongUrl->id)
|
->where('id', $noteWithLongUrl->id)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class WebMentionsTableSeeder extends Seeder
|
||||||
'commentable_id' => '14',
|
'commentable_id' => '14',
|
||||||
'commentable_type' => 'App\Models\Note',
|
'commentable_type' => 'App\Models\Note',
|
||||||
'type' => 'in-reply-to',
|
'type' => 'in-reply-to',
|
||||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}'
|
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}',
|
||||||
]);
|
]);
|
||||||
// WebMention Tantek
|
// WebMention Tantek
|
||||||
WebMention::create([
|
WebMention::create([
|
||||||
|
@ -30,7 +30,7 @@ class WebMentionsTableSeeder extends Seeder
|
||||||
'commentable_id' => '13',
|
'commentable_id' => '13',
|
||||||
'commentable_type' => 'App\Models\Note',
|
'commentable_type' => 'App\Models\Note',
|
||||||
'type' => 'in-reply-to',
|
'type' => 'in-reply-to',
|
||||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["http://tantek.com/"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["http://tantek.com/"], "name": ["Tantek Celik"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["' . config('app.url') . '/notes/D"]}}]}'
|
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["http://tantek.com/"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["http://tantek.com/"], "name": ["Tantek Celik"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["' . config('app.url') . '/notes/D"]}}]}',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ if (! function_exists('normalize_url')) {
|
||||||
$url['path'] = preg_replace_callback(
|
$url['path'] = preg_replace_callback(
|
||||||
array_map(
|
array_map(
|
||||||
function ($str) {
|
function ($str) {
|
||||||
return "/%" . strtoupper($str) . "/x";
|
return '/%' . strtoupper($str) . '/x';
|
||||||
},
|
},
|
||||||
$u
|
$u
|
||||||
),
|
),
|
||||||
|
|
2456
package-lock.json
generated
2456
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -9,8 +9,8 @@
|
||||||
"puppeteer": "^14.1.0"
|
"puppeteer": "^14.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.3",
|
"@babel/core": "^7.18.6",
|
||||||
"@babel/preset-env": "^7.12.1",
|
"@babel/preset-env": "^7.18.6",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"babel-loader": "^8.2.1",
|
"babel-loader": "^8.2.1",
|
||||||
"browserlist": "^1.0.1",
|
"browserlist": "^1.0.1",
|
||||||
|
@ -19,18 +19,18 @@
|
||||||
"cssnano": "^5.0.2",
|
"cssnano": "^5.0.2",
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-webpack-plugin": "^3.0.1",
|
"eslint-webpack-plugin": "^3.0.1",
|
||||||
"mini-css-extract-plugin": "^2.2.1",
|
"mini-css-extract-plugin": "^2.6.1",
|
||||||
"postcss": "^8.1.6",
|
"postcss": "^8.1.6",
|
||||||
"postcss-combine-duplicated-selectors": "^10.0.2",
|
"postcss-combine-duplicated-selectors": "^10.0.2",
|
||||||
"postcss-combine-media-query": "^1.0.1",
|
"postcss-combine-media-query": "^1.0.1",
|
||||||
"postcss-import": "^14.0.0",
|
"postcss-import": "^14.0.0",
|
||||||
"postcss-loader": "^7.0.0",
|
"postcss-loader": "^7.0.0",
|
||||||
"pre-commit": "^1.1.3",
|
"pre-commit": "^1.1.3",
|
||||||
"stylelint": "^14.2.0",
|
"stylelint": "^14.9.1",
|
||||||
"stylelint-config-standard": "^25.0.0",
|
"stylelint-config-standard": "^25.0.0",
|
||||||
"stylelint-webpack-plugin": "^3.1.1",
|
"stylelint-webpack-plugin": "^3.1.1",
|
||||||
"webpack": "^5.3.2",
|
"webpack": "^5.3.2",
|
||||||
"webpack-cli": "^4.0.0"
|
"webpack-cli": "^4.10.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compress": "scripts/compress",
|
"compress": "scripts/compress",
|
||||||
|
|
6
pint.json
Normal file
6
pint.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"preset": "laravel",
|
||||||
|
"rules": {
|
||||||
|
"concat_space": false
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,11 +15,11 @@
|
||||||
@if($media->type == 'download') <p><a class="u-attachment" href="{{ $media->url }}">Download the attached media</a></p>@endif
|
@if($media->type == 'download') <p><a class="u-attachment" href="{{ $media->url }}">Download the attached media</a></p>@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
@php
|
@if ($note->twitter_content)
|
||||||
try {
|
<div class="p-bridgy-twitter-content">
|
||||||
echo '<div class="p-bridgy-twitter-content">' . $note->twitter_content . '</div>';
|
{!! $note->twitter_content !!}
|
||||||
} catch (App\Exceptions\TwitterContentException $exception) {}
|
</div>
|
||||||
@endphp
|
@endif
|
||||||
<div class="note-metadata">
|
<div class="note-metadata">
|
||||||
<div>
|
<div>
|
||||||
<a class="u-url" href="/notes/{{ $note->nb60id }}"><time class="dt-published" datetime="{{ $note->iso8601 }}" title="{{ $note->iso8601 }}">{{ $note->humandiff }}</time></a>@if($note->client) via <a class="client" href="{{ $note->client->client_url }}">{{ $note->client->client_name }}</a>@endif
|
<a class="u-url" href="/notes/{{ $note->nb60id }}"><time class="dt-published" datetime="{{ $note->iso8601 }}" title="{{ $note->iso8601 }}">{{ $note->humandiff }}</time></a>@if($note->client) via <a class="client" href="{{ $note->client->client_url }}">{{ $note->client->client_name }}</a>@endif
|
||||||
|
|
|
@ -29,7 +29,6 @@ use App\Http\Controllers\MicropubController;
|
||||||
use App\Http\Controllers\MicropubMediaController;
|
use App\Http\Controllers\MicropubMediaController;
|
||||||
use App\Http\Controllers\NotesController;
|
use App\Http\Controllers\NotesController;
|
||||||
use App\Http\Controllers\PlacesController;
|
use App\Http\Controllers\PlacesController;
|
||||||
use App\Http\Controllers\SearchController;
|
|
||||||
use App\Http\Controllers\ShortURLsController;
|
use App\Http\Controllers\ShortURLsController;
|
||||||
use App\Http\Controllers\TokenEndpointController;
|
use App\Http\Controllers\TokenEndpointController;
|
||||||
use App\Http\Controllers\WebMentionsController;
|
use App\Http\Controllers\WebMentionsController;
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
/**
|
/**
|
||||||
* Laravel - A PHP Framework For Web Artisans
|
* Laravel - A PHP Framework For Web Artisans
|
||||||
*
|
*
|
||||||
* @package Laravel
|
|
||||||
* @author Taylor Otwell <taylor@laravel.com>
|
* @author Taylor Otwell <taylor@laravel.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$uri = urldecode(
|
$uri = urldecode(
|
||||||
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
|
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
|
|
||||||
namespace Tests\Browser;
|
namespace Tests\Browser;
|
||||||
|
|
||||||
use Tests\DuskTestCase;
|
|
||||||
use Laravel\Dusk\Browser;
|
use Laravel\Dusk\Browser;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Tests\DuskTestCase;
|
||||||
|
|
||||||
class ExampleTest extends DuskTestCase
|
class ExampleTest extends DuskTestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
namespace Tests\Browser;
|
namespace Tests\Browser;
|
||||||
|
|
||||||
use Tests\DuskTestCase;
|
use Tests\DuskTestCase;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
|
|
||||||
class NotesTest extends DuskTestCase
|
class NotesTest extends DuskTestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
namespace Tests;
|
namespace Tests;
|
||||||
|
|
||||||
use Laravel\Dusk\TestCase as BaseTestCase;
|
|
||||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
|
||||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||||
|
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||||
|
use Laravel\Dusk\TestCase as BaseTestCase;
|
||||||
|
|
||||||
abstract class DuskTestCase extends BaseTestCase
|
abstract class DuskTestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@ abstract class DuskTestCase extends BaseTestCase
|
||||||
* Prepare for Dusk test execution.
|
* Prepare for Dusk test execution.
|
||||||
*
|
*
|
||||||
* @beforeClass
|
* @beforeClass
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function prepare()
|
public static function prepare()
|
||||||
|
@ -34,7 +35,7 @@ abstract class DuskTestCase extends BaseTestCase
|
||||||
$options = new ChromeOptions();
|
$options = new ChromeOptions();
|
||||||
$options->addArguments([
|
$options->addArguments([
|
||||||
'headless',
|
'headless',
|
||||||
'disable-gpu'
|
'disable-gpu',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$desiredCapabilities->setCapability(ChromeOptions::CAPABILITY, $options);
|
$desiredCapabilities->setCapability(ChromeOptions::CAPABILITY, $options);
|
||||||
|
|
|
@ -53,8 +53,8 @@ class ActivityStreamTest extends TestCase
|
||||||
],
|
],
|
||||||
'object' => [
|
'object' => [
|
||||||
'type' => 'Note',
|
'type' => 'Note',
|
||||||
'name' => strip_tags($note->note)
|
'name' => strip_tags($note->note),
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ArticlesTest extends TestCase
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/blog', [
|
->post('/admin/blog', [
|
||||||
'title' => 'Test Title',
|
'title' => 'Test Title',
|
||||||
'main' => 'Article content'
|
'main' => 'Article content',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('articles', ['title' => 'Test Title']);
|
$this->assertDatabaseHas('articles', ['title' => 'Test Title']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,11 @@ class ClientsTest extends TestCase
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/clients', [
|
->post('/admin/clients', [
|
||||||
'client_name' => 'Micropublish',
|
'client_name' => 'Micropublish',
|
||||||
'client_url' => 'https://micropublish.net'
|
'client_url' => 'https://micropublish.net',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('clients', [
|
$this->assertDatabaseHas('clients', [
|
||||||
'client_name' => 'Micropublish',
|
'client_name' => 'Micropublish',
|
||||||
'client_url' => 'https://micropublish.net'
|
'client_url' => 'https://micropublish.net',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tests\Feature\Admin;
|
namespace Tests\Feature\Admin;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\Contact;
|
use App\Models\Contact;
|
||||||
|
use App\Models\User;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Handler\MockHandler;
|
use GuzzleHttp\Handler\MockHandler;
|
||||||
use GuzzleHttp\HandlerStack;
|
use GuzzleHttp\HandlerStack;
|
||||||
|
@ -58,7 +58,7 @@ class ContactsTest extends TestCase
|
||||||
$this->assertDatabaseHas('contacts', [
|
$this->assertDatabaseHas('contacts', [
|
||||||
'name' => 'Fred Bloggs',
|
'name' => 'Fred Bloggs',
|
||||||
'nick' => 'fred',
|
'nick' => 'fred',
|
||||||
'homepage' => 'https://fred.blog/gs'
|
'homepage' => 'https://fred.blog/gs',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class ContactsTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function adminCanTriggerRetrievalOfRemoteAvatar(): void
|
public function adminCanTriggerRetrievalOfRemoteAvatar(): void
|
||||||
{
|
{
|
||||||
$html = <<<HTML
|
$html = <<<'HTML'
|
||||||
<div class="h-card">
|
<div class="h-card">
|
||||||
<img class="u-photo" alt="" src="http://tantek.com/tantek.png">
|
<img class="u-photo" alt="" src="http://tantek.com/tantek.png">
|
||||||
</div>
|
</div>
|
||||||
|
@ -181,7 +181,7 @@ class ContactsTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void
|
public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void
|
||||||
{
|
{
|
||||||
$html = <<<HTML
|
$html = <<<'HTML'
|
||||||
<div class="h-card">
|
<div class="h-card">
|
||||||
<img class="u-photo" src="http://tantek.com/tantek.png">
|
<img class="u-photo" src="http://tantek.com/tantek.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,10 +43,10 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/likes', [
|
->post('/admin/likes', [
|
||||||
'like_url' => 'https://example.com'
|
'like_url' => 'https://example.com',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('likes', [
|
$this->assertDatabaseHas('likes', [
|
||||||
'url' => 'https://example.com'
|
'url' => 'https://example.com',
|
||||||
]);
|
]);
|
||||||
Queue::assertPushed(ProcessLike::class);
|
Queue::assertPushed(ProcessLike::class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ class BridgyPosseTest extends TestCase
|
||||||
$response = $this->get($note->longurl);
|
$response = $this->get($note->longurl);
|
||||||
|
|
||||||
$html = $response->content();
|
$html = $response->content();
|
||||||
$this->assertStringContainsString('p-bridgy-twitter-content', $html);
|
$this->assertStringContainsString('Hi @joe__', $html);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ class FeedsTest extends TestCase
|
||||||
'children' => [[
|
'children' => [[
|
||||||
'type' => 'entry',
|
'type' => 'entry',
|
||||||
'post-type' => 'article',
|
'post-type' => 'article',
|
||||||
]]
|
]],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class FeedsTest extends TestCase
|
||||||
'children' => [[
|
'children' => [[
|
||||||
'type' => 'entry',
|
'type' => 'entry',
|
||||||
'post-type' => 'note',
|
'post-type' => 'note',
|
||||||
]]
|
]],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
namespace Tests\Feature;
|
namespace Tests\Feature;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
use Illuminate\Foundation\Testing\WithFaker;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class HorizonTest extends TestCase
|
class HorizonTest extends TestCase
|
||||||
|
@ -13,6 +11,7 @@ class HorizonTest extends TestCase
|
||||||
* Horizon has its own test suite, here we just test it has been installed successfully.
|
* Horizon has its own test suite, here we just test it has been installed successfully.
|
||||||
*
|
*
|
||||||
* @test
|
* @test
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function horizonIsInstalled(): void
|
public function horizonIsInstalled(): void
|
||||||
|
|
|
@ -85,7 +85,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
$job = new ProcessLike($like);
|
$job = new ProcessLike($like);
|
||||||
|
|
||||||
$content = <<<END
|
$content = <<<'END'
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<div class="h-entry">
|
<div class="h-entry">
|
||||||
|
@ -124,7 +124,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
$job = new ProcessLike($like);
|
$job = new ProcessLike($like);
|
||||||
|
|
||||||
$content = <<<END
|
$content = <<<'END'
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<div class="h-entry">
|
<div class="h-entry">
|
||||||
|
@ -167,7 +167,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
$job = new ProcessLike($like);
|
$job = new ProcessLike($like);
|
||||||
|
|
||||||
$content = <<<END
|
$content = <<<'END'
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -4,13 +4,17 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tests\Feature;
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Jobs\SendWebMentions;
|
||||||
|
use App\Jobs\SyndicateNoteToTwitter;
|
||||||
|
use App\Models\Media;
|
||||||
|
use App\Models\Note;
|
||||||
|
use App\Models\Place;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Faker\Factory;
|
use Faker\Factory;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use App\Jobs\{SendWebMentions, SyndicateNoteToTwitter};
|
|
||||||
use App\Models\{Media, Note, Place};
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Support\Facades\Queue;
|
use Illuminate\Support\Facades\Queue;
|
||||||
use Tests\{TestCase, TestToken};
|
use Tests\TestCase;
|
||||||
|
use Tests\TestToken;
|
||||||
|
|
||||||
class MicropubControllerTest extends TestCase
|
class MicropubControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,7 @@ class MicropubControllerTest extends TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
|
*
|
||||||
* @todo Add uncertainty parameter
|
* @todo Add uncertainty parameter
|
||||||
*
|
*
|
||||||
public function micropubClientsCanRequestKnownNearbyPlacesWithUncertaintyParameter(): void
|
public function micropubClientsCanRequestKnownNearbyPlacesWithUncertaintyParameter(): void
|
||||||
|
@ -119,7 +124,7 @@ class MicropubControllerTest extends TestCase
|
||||||
[
|
[
|
||||||
'h' => 'entry',
|
'h' => 'entry',
|
||||||
'content' => $note,
|
'content' => $note,
|
||||||
'mp-syndicate-to' => 'https://twitter.com/jonnybarnes'
|
'mp-syndicate-to' => 'https://twitter.com/jonnybarnes',
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
);
|
);
|
||||||
|
@ -136,7 +141,7 @@ class MicropubControllerTest extends TestCase
|
||||||
[
|
[
|
||||||
'h' => 'card',
|
'h' => 'card',
|
||||||
'name' => 'The Barton Arms',
|
'name' => 'The Barton Arms',
|
||||||
'geo' => 'geo:53.4974,-2.3768'
|
'geo' => 'geo:53.4974,-2.3768',
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
);
|
);
|
||||||
|
@ -199,7 +204,7 @@ class MicropubControllerTest extends TestCase
|
||||||
[
|
[
|
||||||
'h' => 'card',
|
'h' => 'card',
|
||||||
'name' => 'The Barton Arms',
|
'name' => 'The Barton Arms',
|
||||||
'geo' => 'geo:53.4974,-2.3768'
|
'geo' => 'geo:53.4974,-2.3768',
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithIncorrectScope()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithIncorrectScope()]
|
||||||
);
|
);
|
||||||
|
@ -366,7 +371,7 @@ class MicropubControllerTest extends TestCase
|
||||||
$response
|
$response
|
||||||
->assertJson([
|
->assertJson([
|
||||||
'response' => 'error',
|
'response' => 'error',
|
||||||
'error' => 'unauthorized'
|
'error' => 'unauthorized',
|
||||||
])
|
])
|
||||||
->assertStatus(401);
|
->assertStatus(401);
|
||||||
}
|
}
|
||||||
|
@ -394,7 +399,7 @@ class MicropubControllerTest extends TestCase
|
||||||
$response
|
$response
|
||||||
->assertJson([
|
->assertJson([
|
||||||
'response' => 'error',
|
'response' => 'error',
|
||||||
'error' => 'insufficient_scope'
|
'error' => 'insufficient_scope',
|
||||||
])
|
])
|
||||||
->assertStatus(401);
|
->assertStatus(401);
|
||||||
}
|
}
|
||||||
|
@ -415,7 +420,7 @@ class MicropubControllerTest extends TestCase
|
||||||
$response
|
$response
|
||||||
->assertJson([
|
->assertJson([
|
||||||
'response' => 'error',
|
'response' => 'error',
|
||||||
'error_description' => 'unsupported_request_type'
|
'error_description' => 'unsupported_request_type',
|
||||||
])
|
])
|
||||||
->assertStatus(500);
|
->assertStatus(500);
|
||||||
}
|
}
|
||||||
|
@ -430,7 +435,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'type' => ['h-card'],
|
'type' => ['h-card'],
|
||||||
'properties' => [
|
'properties' => [
|
||||||
'name' => $faker->name,
|
'name' => $faker->name,
|
||||||
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude
|
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
|
@ -450,7 +455,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'type' => ['h-card'],
|
'type' => ['h-card'],
|
||||||
'properties' => [
|
'properties' => [
|
||||||
'name' => $faker->name,
|
'name' => $faker->name,
|
||||||
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude . ';u=35'
|
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude . ';u=35',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
|
|
|
@ -29,7 +29,7 @@ class OwnYourGramTest extends TestCase
|
||||||
'syndication' => ['https://www.instagram.com/p/BVC_nVTBFfi/'],
|
'syndication' => ['https://www.instagram.com/p/BVC_nVTBFfi/'],
|
||||||
'photo' => [
|
'photo' => [
|
||||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||||
'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg'
|
'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -37,15 +37,15 @@ class OwnYourGramTest extends TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$response->assertStatus(201)->assertJson([
|
$response->assertStatus(201)->assertJson([
|
||||||
'response' => 'created'
|
'response' => 'created',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('media_endpoint', [
|
$this->assertDatabaseHas('media_endpoint', [
|
||||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||||
'path' => 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg'
|
'path' => 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('notes', [
|
$this->assertDatabaseHas('notes', [
|
||||||
'note' => 'How beautiful are the plates and chopsticks',
|
'note' => 'How beautiful are the plates and chopsticks',
|
||||||
'instagram_url' => 'https://www.instagram.com/p/BVC_nVTBFfi/'
|
'instagram_url' => 'https://www.instagram.com/p/BVC_nVTBFfi/',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,10 +54,10 @@ class SwarmTest extends TestCase
|
||||||
->assertStatus(201)
|
->assertStatus(201)
|
||||||
->assertJson(['response' => 'created']);
|
->assertJson(['response' => 'created']);
|
||||||
$this->assertDatabaseHas('notes', [
|
$this->assertDatabaseHas('notes', [
|
||||||
'swarm_url' => 'https://www.swarmapp.com/checkin/abc'
|
'swarm_url' => 'https://www.swarmapp.com/checkin/abc',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('places', [
|
$this->assertDatabaseHas('places', [
|
||||||
'external_urls' => '{"foursquare": "https://foursquare.com/v/123456"}'
|
'external_urls' => '{"foursquare": "https://foursquare.com/v/123456"}',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Queue::assertPushed(SendWebMentions::class);
|
Queue::assertPushed(SendWebMentions::class);
|
||||||
|
@ -101,7 +101,7 @@ class SwarmTest extends TestCase
|
||||||
->assertStatus(201)
|
->assertStatus(201)
|
||||||
->assertJson(['response' => 'created']);
|
->assertJson(['response' => 'created']);
|
||||||
$this->assertDatabaseHas('places', [
|
$this->assertDatabaseHas('places', [
|
||||||
'external_urls' => '{"osm": "https://www.openstreetmap.org/way/123456"}'
|
'external_urls' => '{"osm": "https://www.openstreetmap.org/way/123456"}',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Queue::assertPushed(SendWebMentions::class);
|
Queue::assertPushed(SendWebMentions::class);
|
||||||
|
@ -144,7 +144,7 @@ class SwarmTest extends TestCase
|
||||||
->assertStatus(201)
|
->assertStatus(201)
|
||||||
->assertJson(['response' => 'created']);
|
->assertJson(['response' => 'created']);
|
||||||
$this->assertDatabaseHas('places', [
|
$this->assertDatabaseHas('places', [
|
||||||
'external_urls' => '{"default": "https://www.example.org/way/123456"}'
|
'external_urls' => '{"default": "https://www.example.org/way/123456"}',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Queue::assertPushed(SendWebMentions::class);
|
Queue::assertPushed(SendWebMentions::class);
|
||||||
|
@ -178,10 +178,10 @@ class SwarmTest extends TestCase
|
||||||
->assertStatus(201)
|
->assertStatus(201)
|
||||||
->assertJson(['response' => 'created']);
|
->assertJson(['response' => 'created']);
|
||||||
$this->assertDatabaseHas('places', [
|
$this->assertDatabaseHas('places', [
|
||||||
'external_urls' => '{"foursquare": "https://foursquare.com/v/654321"}'
|
'external_urls' => '{"foursquare": "https://foursquare.com/v/654321"}',
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('notes', [
|
$this->assertDatabaseHas('notes', [
|
||||||
'swarm_url' => 'https://www.swarmapp.com/checkin/def'
|
'swarm_url' => 'https://www.swarmapp.com/checkin/def',
|
||||||
]);
|
]);
|
||||||
// Check the default text content for the note was saved
|
// Check the default text content for the note was saved
|
||||||
$this->get($response->__get('headers')->get('location'))->assertSee('📍');
|
$this->get($response->__get('headers')->get('location'))->assertSee('📍');
|
||||||
|
@ -280,10 +280,10 @@ class SwarmTest extends TestCase
|
||||||
[
|
[
|
||||||
'type' => ['h-entry'],
|
'type' => ['h-entry'],
|
||||||
'properties' => [
|
'properties' => [
|
||||||
'published' => [Carbon::now()->toDateTimeString()]
|
'published' => [Carbon::now()->toDateTimeString()],
|
||||||
],
|
],
|
||||||
'syndication' => [
|
'syndication' => [
|
||||||
'https://www.swarmapp.com/user/199841/checkin/5c4b1ac56dcf04002c0a4f58'
|
'https://www.swarmapp.com/user/199841/checkin/5c4b1ac56dcf04002c0a4f58',
|
||||||
],
|
],
|
||||||
'checkin' => [
|
'checkin' => [
|
||||||
'type' => ['h-card'],
|
'type' => ['h-card'],
|
||||||
|
@ -295,9 +295,9 @@ class SwarmTest extends TestCase
|
||||||
'street-address' => ['65 Oldham St.'],
|
'street-address' => ['65 Oldham St.'],
|
||||||
'locality' => ['Manchester'],
|
'locality' => ['Manchester'],
|
||||||
'country-name' => ['United Kingdom'],
|
'country-name' => ['United Kingdom'],
|
||||||
'postal-code' => ['M1 1JR']
|
'postal-code' => ['M1 1JR'],
|
||||||
],
|
],
|
||||||
'value' => 'https://foursquare.com/v/4ade0e46f964a520bf6f21e3'
|
'value' => 'https://foursquare.com/v/4ade0e46f964a520bf6f21e3',
|
||||||
],
|
],
|
||||||
'location' => [
|
'location' => [
|
||||||
'type' => ['h-adr'],
|
'type' => ['h-adr'],
|
||||||
|
@ -307,8 +307,8 @@ class SwarmTest extends TestCase
|
||||||
'street-address' => ['65 Oldham St.'],
|
'street-address' => ['65 Oldham St.'],
|
||||||
'locality' => ['Manchester'],
|
'locality' => ['Manchester'],
|
||||||
'country-name' => ['United Kingdom'],
|
'country-name' => ['United Kingdom'],
|
||||||
'postal-code' => ['M1 1JR']
|
'postal-code' => ['M1 1JR'],
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
|
|
|
@ -59,7 +59,7 @@ class TokenEndpointTest extends TestCase
|
||||||
]);
|
]);
|
||||||
$response->assertStatus(401);
|
$response->assertStatus(401);
|
||||||
$response->assertJson([
|
$response->assertJson([
|
||||||
'error' => 'There was an error verifying the authorisation code.'
|
'error' => 'There was an error verifying the authorisation code.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class TokenEndpointTest extends TestCase
|
||||||
]);
|
]);
|
||||||
$response->assertStatus(400);
|
$response->assertStatus(400);
|
||||||
$response->assertJson([
|
$response->assertJson([
|
||||||
'error' => 'Can’t determine the authorisation endpoint.']
|
'error' => 'Can’t determine the authorisation endpoint.', ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,14 @@ class TokenServiceTest extends TestCase
|
||||||
$data = [
|
$data = [
|
||||||
'me' => 'https://example.org',
|
'me' => 'https://example.org',
|
||||||
'client_id' => 'https://quill.p3k.io',
|
'client_id' => 'https://quill.p3k.io',
|
||||||
'scope' => 'post'
|
'scope' => 'post',
|
||||||
];
|
];
|
||||||
$token = $tokenService->getNewToken($data);
|
$token = $tokenService->getNewToken($data);
|
||||||
$valid = $tokenService->validateToken($token);
|
$valid = $tokenService->validateToken($token);
|
||||||
$validData = [
|
$validData = [
|
||||||
'me' => $valid->claims()->get('me'),
|
'me' => $valid->claims()->get('me'),
|
||||||
'client_id' => $valid->claims()->get('client_id'),
|
'client_id' => $valid->claims()->get('client_id'),
|
||||||
'scope' => $valid->claims()->get('scope')
|
'scope' => $valid->claims()->get('scope'),
|
||||||
];
|
];
|
||||||
$this->assertSame($data, $validData);
|
$this->assertSame($data, $validData);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ class TokenServiceTest extends TestCase
|
||||||
$data = [
|
$data = [
|
||||||
'me' => 'https://example.org',
|
'me' => 'https://example.org',
|
||||||
'client_id' => 'https://quill.p3k.io',
|
'client_id' => 'https://quill.p3k.io',
|
||||||
'scope' => 'post'
|
'scope' => 'post',
|
||||||
];
|
];
|
||||||
|
|
||||||
$config = resolve(Configuration::class);
|
$config = resolve(Configuration::class);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue