Upgrade to Laravel 9 (#252)
This commit is contained in:
parent
16a4d89d18
commit
78bd468d3d
28 changed files with 2235 additions and 3426 deletions
|
@ -138,8 +138,8 @@ class ContactsController extends Controller
|
||||||
}
|
}
|
||||||
$mf2 = \Mf2\parse((string) $response->getBody(), $contact->homepage);
|
$mf2 = \Mf2\parse((string) $response->getBody(), $contact->homepage);
|
||||||
foreach ($mf2['items'] as $microformat) {
|
foreach ($mf2['items'] as $microformat) {
|
||||||
if (Arr::get($microformat, 'type.0') == 'h-card') {
|
if (Arr::get($microformat, 'type.0') === 'h-card') {
|
||||||
$avatarURL = Arr::get($microformat, 'properties.photo.0');
|
$avatarURL = Arr::get($microformat, 'properties.photo.0.value');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Models\Note;
|
|
||||||
use Illuminate\View\View;
|
|
||||||
|
|
||||||
class SearchController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display search results.
|
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
|
||||||
public function search(): View
|
|
||||||
{
|
|
||||||
$notes = Note::search(request()->input('terms'))->paginate(10);
|
|
||||||
|
|
||||||
return view('search', compact('notes'));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class TrustProxies extends Middleware
|
class TrustProxies extends Middleware
|
||||||
|
@ -19,5 +19,10 @@ class TrustProxies extends Middleware
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
protected $headers =
|
||||||
|
Request::HEADER_X_FORWARDED_FOR |
|
||||||
|
Request::HEADER_X_FORWARDED_HOST |
|
||||||
|
Request::HEADER_X_FORWARDED_PORT |
|
||||||
|
Request::HEADER_X_FORWARDED_PROTO |
|
||||||
|
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,58 +5,19 @@ declare(strict_types=1);
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Cviebrock\EloquentSluggable\Sluggable;
|
use Cviebrock\EloquentSluggable\Sluggable;
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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 Illuminate\Support\Carbon;
|
|
||||||
use League\CommonMark\Block\Element\FencedCode;
|
|
||||||
use League\CommonMark\Block\Element\IndentedCode;
|
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
use League\CommonMark\Environment;
|
use League\CommonMark\Environment\Environment;
|
||||||
|
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||||
|
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
||||||
|
use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode;
|
||||||
|
use League\CommonMark\MarkdownConverter;
|
||||||
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
|
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
|
||||||
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
|
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Article.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $titleurl
|
|
||||||
* @property string|null $url
|
|
||||||
* @property string $title
|
|
||||||
* @property string $main
|
|
||||||
* @property int $published
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property Carbon|null $deleted_at
|
|
||||||
* @property-read string $html
|
|
||||||
* @property-read string $human_time
|
|
||||||
* @property-read string $link
|
|
||||||
* @property-read string $pubdate
|
|
||||||
* @property-read string $tooltip_time
|
|
||||||
* @property-read string $w3c_time
|
|
||||||
* @method static Builder|Article date($year = null, $month = null)
|
|
||||||
* @method static Builder|Article findSimilarSlugs($attribute, $config, $slug)
|
|
||||||
* @method static bool|null forceDelete()
|
|
||||||
* @method static Builder|Article newModelQuery()
|
|
||||||
* @method static Builder|Article newQuery()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Article onlyTrashed()
|
|
||||||
* @method static Builder|Article query()
|
|
||||||
* @method static bool|null restore()
|
|
||||||
* @method static Builder|Article whereCreatedAt($value)
|
|
||||||
* @method static Builder|Article whereDeletedAt($value)
|
|
||||||
* @method static Builder|Article whereId($value)
|
|
||||||
* @method static Builder|Article whereMain($value)
|
|
||||||
* @method static Builder|Article wherePublished($value)
|
|
||||||
* @method static Builder|Article whereTitle($value)
|
|
||||||
* @method static Builder|Article whereTitleurl($value)
|
|
||||||
* @method static Builder|Article whereUpdatedAt($value)
|
|
||||||
* @method static Builder|Article whereUrl($value)
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Article withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Article withoutTrashed()
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Article extends Model
|
class Article extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
@ -105,12 +66,13 @@ class Article extends Model
|
||||||
*/
|
*/
|
||||||
public function getHtmlAttribute(): string
|
public function getHtmlAttribute(): string
|
||||||
{
|
{
|
||||||
$environment = Environment::createCommonMarkEnvironment();
|
$environment = new Environment();
|
||||||
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer());
|
$environment->addExtension(new CommonMarkCoreExtension());
|
||||||
$environment->addBlockRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||||
$commonMarkConverter = new CommonMarkConverter([], $environment);
|
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||||
|
$markdownConverter = new MarkdownConverter($environment);
|
||||||
|
|
||||||
return $commonMarkConverter->convertToHtml($this->main);
|
return $markdownConverter->convert($this->main)->getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
|
@ -4,36 +4,11 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Contact.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $nick
|
|
||||||
* @property string $name
|
|
||||||
* @property string|null $homepage
|
|
||||||
* @property string|null $twitter
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property string|null $facebook
|
|
||||||
* @method static Builder|Contact newModelQuery()
|
|
||||||
* @method static Builder|Contact newQuery()
|
|
||||||
* @method static Builder|Contact query()
|
|
||||||
* @method static Builder|Contact whereCreatedAt($value)
|
|
||||||
* @method static Builder|Contact whereFacebook($value)
|
|
||||||
* @method static Builder|Contact whereHomepage($value)
|
|
||||||
* @method static Builder|Contact whereId($value)
|
|
||||||
* @method static Builder|Contact whereName($value)
|
|
||||||
* @method static Builder|Contact whereNick($value)
|
|
||||||
* @method static Builder|Contact whereTwitter($value)
|
|
||||||
* @method static Builder|Contact whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Contact extends Model
|
class Contact extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Traits\FilterHtml;
|
use App\Traits\FilterHtml;
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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;
|
||||||
|
@ -13,28 +12,6 @@ use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Mf2;
|
use Mf2;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Like.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $url
|
|
||||||
* @property string|null $author_name
|
|
||||||
* @property string|null $author_url
|
|
||||||
* @property string|null $content
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @method static Builder|Like newModelQuery()
|
|
||||||
* @method static Builder|Like newQuery()
|
|
||||||
* @method static Builder|Like query()
|
|
||||||
* @method static Builder|Like whereAuthorName($value)
|
|
||||||
* @method static Builder|Like whereAuthorUrl($value)
|
|
||||||
* @method static Builder|Like whereContent($value)
|
|
||||||
* @method static Builder|Like whereCreatedAt($value)
|
|
||||||
* @method static Builder|Like whereId($value)
|
|
||||||
* @method static Builder|Like whereUpdatedAt($value)
|
|
||||||
* @method static Builder|Like whereUrl($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Like extends Model
|
class Like extends Model
|
||||||
{
|
{
|
||||||
use FilterHtml;
|
use FilterHtml;
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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;
|
||||||
|
@ -12,34 +11,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Media.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string|null $token
|
|
||||||
* @property string $path
|
|
||||||
* @property string $type
|
|
||||||
* @property int|null $note_id
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property string|null $image_widths
|
|
||||||
* @property-read string $mediumurl
|
|
||||||
* @property-read string $smallurl
|
|
||||||
* @property-read string $url
|
|
||||||
* @property-read Note|null $note
|
|
||||||
* @method static Builder|Media newModelQuery()
|
|
||||||
* @method static Builder|Media newQuery()
|
|
||||||
* @method static Builder|Media query()
|
|
||||||
* @method static Builder|Media whereCreatedAt($value)
|
|
||||||
* @method static Builder|Media whereId($value)
|
|
||||||
* @method static Builder|Media whereImageWidths($value)
|
|
||||||
* @method static Builder|Media whereNoteId($value)
|
|
||||||
* @method static Builder|Media wherePath($value)
|
|
||||||
* @method static Builder|Media whereToken($value)
|
|
||||||
* @method static Builder|Media whereType($value)
|
|
||||||
* @method static Builder|Media whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Media extends Model
|
class Media extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
@ -12,26 +11,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\MicropubClient.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $client_url
|
|
||||||
* @property string $client_name
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property-read Collection|\App\Models\Note[] $notes
|
|
||||||
* @property-read int|null $notes_count
|
|
||||||
* @method static Builder|MicropubClient newModelQuery()
|
|
||||||
* @method static Builder|MicropubClient newQuery()
|
|
||||||
* @method static Builder|MicropubClient query()
|
|
||||||
* @method static Builder|MicropubClient whereClientName($value)
|
|
||||||
* @method static Builder|MicropubClient whereClientUrl($value)
|
|
||||||
* @method static Builder|MicropubClient whereCreatedAt($value)
|
|
||||||
* @method static Builder|MicropubClient whereId($value)
|
|
||||||
* @method static Builder|MicropubClient whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class MicropubClient extends Model
|
class MicropubClient extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -10,92 +10,22 @@ 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\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany};
|
||||||
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model, SoftDeletes};
|
use Illuminate\Database\Eloquent\{Builder, Factories\HasFactory, Model, SoftDeletes};
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
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;
|
||||||
use Laravel\Scout\Searchable;
|
use League\CommonMark\Environment\Environment;
|
||||||
use League\CommonMark\Block\Element\{FencedCode, IndentedCode};
|
|
||||||
use League\CommonMark\Extension\Autolink\AutolinkExtension;
|
use League\CommonMark\Extension\Autolink\AutolinkExtension;
|
||||||
use League\CommonMark\{CommonMarkConverter, Environment};
|
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||||
|
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
||||||
|
use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode;
|
||||||
|
use League\CommonMark\MarkdownConverter;
|
||||||
use Normalizer;
|
use Normalizer;
|
||||||
use Spatie\CommonMarkHighlighter\{FencedCodeRenderer, IndentedCodeRenderer};
|
use Spatie\CommonMarkHighlighter\{FencedCodeRenderer, IndentedCodeRenderer};
|
||||||
use App\Models\Tag;
|
|
||||||
use App\Models\MicropubClient;
|
|
||||||
use App\Models\WebMention;
|
|
||||||
use App\Models\Place;
|
|
||||||
use App\Models\Media;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Note.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string|null $note
|
|
||||||
* @property string|null $in_reply_to
|
|
||||||
* @property string $shorturl
|
|
||||||
* @property string|null $location
|
|
||||||
* @property int|null $photo
|
|
||||||
* @property string|null $tweet_id
|
|
||||||
* @property string|null $client_id
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property Carbon|null $deleted_at
|
|
||||||
* @property int|null $place_id
|
|
||||||
* @property string|null $facebook_url
|
|
||||||
* @property string|null $searchable
|
|
||||||
* @property string|null $swarm_url
|
|
||||||
* @property string|null $instagram_url
|
|
||||||
* @property-read MicropubClient|null $client
|
|
||||||
* @property-read string|null $address
|
|
||||||
* @property-read string $content
|
|
||||||
* @property-read string $humandiff
|
|
||||||
* @property-read string $iso8601
|
|
||||||
* @property-read float|null $latitude
|
|
||||||
* @property-read float|null $longitude
|
|
||||||
* @property-read string $longurl
|
|
||||||
* @property-read string $nb60id
|
|
||||||
* @property-read string $pubdate
|
|
||||||
* @property-read object|null $twitter
|
|
||||||
* @property-read string $twitter_content
|
|
||||||
* @property-read Collection|Media[] $media
|
|
||||||
* @property-read int|null $media_count
|
|
||||||
* @property-read Place|null $place
|
|
||||||
* @property-read Collection|Tag[] $tags
|
|
||||||
* @property-read int|null $tags_count
|
|
||||||
* @property-read Collection|WebMention[] $webmentions
|
|
||||||
* @property-read int|null $webmentions_count
|
|
||||||
* @method static bool|null forceDelete()
|
|
||||||
* @method static Builder|Note nb60($nb60id)
|
|
||||||
* @method static Builder|Note newModelQuery()
|
|
||||||
* @method static Builder|Note newQuery()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Note onlyTrashed()
|
|
||||||
* @method static Builder|Note query()
|
|
||||||
* @method static bool|null restore()
|
|
||||||
* @method static Builder|Note whereClientId($value)
|
|
||||||
* @method static Builder|Note whereCreatedAt($value)
|
|
||||||
* @method static Builder|Note whereDeletedAt($value)
|
|
||||||
* @method static Builder|Note whereFacebookUrl($value)
|
|
||||||
* @method static Builder|Note whereId($value)
|
|
||||||
* @method static Builder|Note whereInReplyTo($value)
|
|
||||||
* @method static Builder|Note whereInstagramUrl($value)
|
|
||||||
* @method static Builder|Note whereLocation($value)
|
|
||||||
* @method static Builder|Note whereNote($value)
|
|
||||||
* @method static Builder|Note wherePhoto($value)
|
|
||||||
* @method static Builder|Note wherePlaceId($value)
|
|
||||||
* @method static Builder|Note whereSearchable($value)
|
|
||||||
* @method static Builder|Note whereShorturl($value)
|
|
||||||
* @method static Builder|Note whereSwarmUrl($value)
|
|
||||||
* @method static Builder|Note whereTweetId($value)
|
|
||||||
* @method static Builder|Note whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Note withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|Note withoutTrashed()
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Note extends Model
|
class Note extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
use Searchable;
|
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -597,13 +527,14 @@ class Note extends Model
|
||||||
*/
|
*/
|
||||||
private function convertMarkdown(string $note): string
|
private function convertMarkdown(string $note): string
|
||||||
{
|
{
|
||||||
$environment = Environment::createCommonMarkEnvironment();
|
$environment = new Environment();
|
||||||
|
$environment->addExtension(new CommonMarkCoreExtension());
|
||||||
$environment->addExtension(new AutolinkExtension());
|
$environment->addExtension(new AutolinkExtension());
|
||||||
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer());
|
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||||
$environment->addBlockRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||||
$converter = new CommonMarkConverter([], $environment);
|
$markdownConverter = new MarkdownConverter($environment);
|
||||||
|
|
||||||
return $converter->convertToHtml($note);
|
return $markdownConverter->convert($note)->getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,50 +5,11 @@ declare(strict_types=1);
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Cviebrock\EloquentSluggable\Sluggable;
|
use Cviebrock\EloquentSluggable\Sluggable;
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
|
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Place.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $name
|
|
||||||
* @property string $slug
|
|
||||||
* @property string|null $description
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property string|null $icon
|
|
||||||
* @property string|null $foursquare
|
|
||||||
* @property mixed|null $external_urls
|
|
||||||
* @property float|null $latitude
|
|
||||||
* @property float|null $longitude
|
|
||||||
* @property-read string $longurl
|
|
||||||
* @property-read string $shorturl
|
|
||||||
* @property-read string $uri
|
|
||||||
* @property-read Collection|\App\Models\Note[] $notes
|
|
||||||
* @property-read int|null $notes_count
|
|
||||||
* @method static Builder|Place findSimilarSlugs($attribute, $config, $slug)
|
|
||||||
* @method static Builder|Place near($location, $distance = 1000)
|
|
||||||
* @method static Builder|Place newModelQuery()
|
|
||||||
* @method static Builder|Place newQuery()
|
|
||||||
* @method static Builder|Place query()
|
|
||||||
* @method static Builder|Place whereCreatedAt($value)
|
|
||||||
* @method static Builder|Place whereDescription($value)
|
|
||||||
* @method static Builder|Place whereExternalURL($url)
|
|
||||||
* @method static Builder|Place whereExternalUrls($value)
|
|
||||||
* @method static Builder|Place whereFoursquare($value)
|
|
||||||
* @method static Builder|Place whereIcon($value)
|
|
||||||
* @method static Builder|Place whereId($value)
|
|
||||||
* @method static Builder|Place whereLatitude($value)
|
|
||||||
* @method static Builder|Place whereLongitude($value)
|
|
||||||
* @method static Builder|Place whereName($value)
|
|
||||||
* @method static Builder|Place whereSlug($value)
|
|
||||||
* @method static Builder|Place whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Place extends Model
|
class Place extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
@ -13,26 +12,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\Tag.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $tag
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property-read Collection|Bookmark[] $bookmarks
|
|
||||||
* @property-read int|null $bookmarks_count
|
|
||||||
* @property-read Collection|Note[] $notes
|
|
||||||
* @property-read int|null $notes_count
|
|
||||||
* @method static Builder|Tag newModelQuery()
|
|
||||||
* @method static Builder|Tag newQuery()
|
|
||||||
* @method static Builder|Tag query()
|
|
||||||
* @method static Builder|Tag whereCreatedAt($value)
|
|
||||||
* @method static Builder|Tag whereId($value)
|
|
||||||
* @method static Builder|Tag whereTag($value)
|
|
||||||
* @method static Builder|Tag whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class Tag extends Model
|
class Tag extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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;
|
||||||
|
@ -13,28 +12,6 @@ use Illuminate\Notifications\DatabaseNotificationCollection;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\User.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $name
|
|
||||||
* @property string $password
|
|
||||||
* @property string|null $remember_token
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property-read DatabaseNotificationCollection|DatabaseNotification[] $notifications
|
|
||||||
* @property-read int|null $notifications_count
|
|
||||||
* @method static Builder|User newModelQuery()
|
|
||||||
* @method static Builder|User newQuery()
|
|
||||||
* @method static Builder|User query()
|
|
||||||
* @method static Builder|User whereCreatedAt($value)
|
|
||||||
* @method static Builder|User whereId($value)
|
|
||||||
* @method static Builder|User whereName($value)
|
|
||||||
* @method static Builder|User wherePassword($value)
|
|
||||||
* @method static Builder|User whereRememberToken($value)
|
|
||||||
* @method static Builder|User whereUpdatedAt($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace App\Models;
|
||||||
|
|
||||||
use App\Traits\FilterHtml;
|
use App\Traits\FilterHtml;
|
||||||
use Codebird\Codebird;
|
use Codebird\Codebird;
|
||||||
use Eloquent;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
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;
|
||||||
|
@ -17,42 +16,6 @@ use Illuminate\Support\Facades\Cache;
|
||||||
use Jonnybarnes\WebmentionsParser\Authorship;
|
use Jonnybarnes\WebmentionsParser\Authorship;
|
||||||
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
|
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\WebMention.
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property string $source
|
|
||||||
* @property string $target
|
|
||||||
* @property int|null $commentable_id
|
|
||||||
* @property string|null $commentable_type
|
|
||||||
* @property string|null $type
|
|
||||||
* @property string|null $content
|
|
||||||
* @property int $verified
|
|
||||||
* @property Carbon|null $created_at
|
|
||||||
* @property Carbon|null $updated_at
|
|
||||||
* @property string|null $deleted_at
|
|
||||||
* @property mixed|null $mf2
|
|
||||||
* @property-read WebMention|null $commentable
|
|
||||||
* @property-read array $author
|
|
||||||
* @property-read string|null $published
|
|
||||||
* @property-read string|null $reply
|
|
||||||
* @method static Builder|WebMention newModelQuery()
|
|
||||||
* @method static Builder|WebMention newQuery()
|
|
||||||
* @method static Builder|WebMention query()
|
|
||||||
* @method static Builder|WebMention whereCommentableId($value)
|
|
||||||
* @method static Builder|WebMention whereCommentableType($value)
|
|
||||||
* @method static Builder|WebMention whereContent($value)
|
|
||||||
* @method static Builder|WebMention whereCreatedAt($value)
|
|
||||||
* @method static Builder|WebMention whereDeletedAt($value)
|
|
||||||
* @method static Builder|WebMention whereId($value)
|
|
||||||
* @method static Builder|WebMention whereMf2($value)
|
|
||||||
* @method static Builder|WebMention whereSource($value)
|
|
||||||
* @method static Builder|WebMention whereTarget($value)
|
|
||||||
* @method static Builder|WebMention whereType($value)
|
|
||||||
* @method static Builder|WebMention whereUpdatedAt($value)
|
|
||||||
* @method static Builder|WebMention whereVerified($value)
|
|
||||||
* @mixin Eloquent
|
|
||||||
*/
|
|
||||||
class WebMention extends Model
|
class WebMention extends Model
|
||||||
{
|
{
|
||||||
use FilterHtml;
|
use FilterHtml;
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Providers;
|
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Gate;
|
|
||||||
use Laravel\Telescope\IncomingEntry;
|
|
||||||
use Laravel\Telescope\Telescope;
|
|
||||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
|
||||||
|
|
||||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Register any application services.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
Telescope::night();
|
|
||||||
|
|
||||||
$this->hideSensitiveRequestDetails();
|
|
||||||
|
|
||||||
Telescope::filter(function (IncomingEntry $entry) {
|
|
||||||
if ($this->app->isLocal()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $entry->isReportableException() ||
|
|
||||||
$entry->isFailedJob() ||
|
|
||||||
$entry->isScheduledTask() ||
|
|
||||||
$entry->hasMonitoredTag();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prevent sensitive request details from being logged by Telescope.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function hideSensitiveRequestDetails()
|
|
||||||
{
|
|
||||||
if ($this->app->isLocal()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Telescope::hideRequestParameters(['_token']);
|
|
||||||
|
|
||||||
Telescope::hideRequestHeaders([
|
|
||||||
'cookie',
|
|
||||||
'x-csrf-token',
|
|
||||||
'x-xsrf-token',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the Telescope gate.
|
|
||||||
*
|
|
||||||
* This gate determines who can access Telescope in non-local environments.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function gate()
|
|
||||||
{
|
|
||||||
Gate::define('viewTelescope', function ($user) {
|
|
||||||
return in_array($user->name, [
|
|
||||||
'jonny',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -13,8 +13,7 @@
|
||||||
"ext-intl": "*",
|
"ext-intl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"cviebrock/eloquent-sluggable": "^8.0",
|
"cviebrock/eloquent-sluggable": "^9.0",
|
||||||
"fideloper/proxy": "~4.0",
|
|
||||||
"fruitcake/laravel-cors": "^2.0",
|
"fruitcake/laravel-cors": "^2.0",
|
||||||
"guzzlehttp/guzzle": "^7.0.1",
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
"indieauth/client": "^1.1",
|
"indieauth/client": "^1.1",
|
||||||
|
@ -22,19 +21,16 @@
|
||||||
"jonnybarnes/indieweb": "~0.2",
|
"jonnybarnes/indieweb": "~0.2",
|
||||||
"jonnybarnes/webmentions-parser": "~0.5",
|
"jonnybarnes/webmentions-parser": "~0.5",
|
||||||
"jublonet/codebird-php": "4.0.0-beta.1",
|
"jublonet/codebird-php": "4.0.0-beta.1",
|
||||||
"laravel/framework": "^8.0",
|
"laravel/framework": "^9.0",
|
||||||
"laravel/horizon": "^5.0",
|
"laravel/horizon": "^5.0",
|
||||||
"laravel/scout": "^8.0",
|
|
||||||
"laravel/telescope": "^4.0",
|
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"lcobucci/jwt": "^4.0",
|
"lcobucci/jwt": "^4.0",
|
||||||
"league/commonmark": "^1.0",
|
"league/commonmark": "^2.0",
|
||||||
"league/flysystem-aws-s3-v3": "^1.0",
|
"league/flysystem-aws-s3-v3": "^3.0",
|
||||||
"mf2/mf2": "~0.3",
|
"mf2/mf2": "~0.3",
|
||||||
"pmatseykanets/laravel-scout-postgres": "^7.3",
|
|
||||||
"predis/predis": "~1.0",
|
"predis/predis": "~1.0",
|
||||||
"spatie/browsershot": "~3.0",
|
"spatie/browsershot": "~3.0",
|
||||||
"spatie/commonmark-highlighter": "^2.0",
|
"spatie/commonmark-highlighter": "^3.0",
|
||||||
"tgalopin/html-sanitizer": "^1.1"
|
"tgalopin/html-sanitizer": "^1.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
@ -44,7 +40,7 @@
|
||||||
"fakerphp/faker": "^1.9.2",
|
"fakerphp/faker": "^1.9.2",
|
||||||
"laravel/dusk": "^6.0",
|
"laravel/dusk": "^6.0",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"nunomaduro/collision": "^5.0",
|
"nunomaduro/collision": "^6.1",
|
||||||
"phpunit/php-code-coverage": "^9.2",
|
"phpunit/php-code-coverage": "^9.2",
|
||||||
"phpunit/phpunit": "^9.0",
|
"phpunit/phpunit": "^9.0",
|
||||||
"spatie/laravel-ignition": "^1.0",
|
"spatie/laravel-ignition": "^1.0",
|
||||||
|
|
3066
composer.lock
generated
3066
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -220,7 +220,6 @@ return [
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
App\Providers\HorizonServiceProvider::class,
|
App\Providers\HorizonServiceProvider::class,
|
||||||
App\Providers\TelescopeServiceProvider::class,
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ return [
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
'schema' => 'public',
|
'search_path' => 'public',
|
||||||
'sslmode' => 'prefer',
|
'sslmode' => 'prefer',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Default Search Engine
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option controls the default search connection that gets used while
|
|
||||||
| using Laravel Scout. This connection is used when syncing all models
|
|
||||||
| to the search service. You should adjust this based on your needs.
|
|
||||||
|
|
|
||||||
| Supported: "algolia", "elasticsearch", "null"
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'driver' => env('SCOUT_DRIVER'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Index Prefix
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may specify a prefix that will be applied to all search index
|
|
||||||
| names used by Scout. This prefix may be useful if you have multiple
|
|
||||||
| "tenants" or applications sharing the same search infrastructure.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'prefix' => env('SCOUT_PREFIX', ''),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Queue Data Syncing
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option allows you to control if the operations that sync your data
|
|
||||||
| with your search engines are queued. When this is set to "true" then
|
|
||||||
| all automatic data syncing will get queued for better performance.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'queue' => true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Algolia Configuration
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may configure your Algolia settings. Algolia is a cloud hosted
|
|
||||||
| search engine which works great with Scout out of the box. Just plug
|
|
||||||
| in your application ID and admin API key to get started searching.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'algolia' => [
|
|
||||||
'id' => env('ALGOLIA_APP_ID', ''),
|
|
||||||
'secret' => env('ALGOLIA_SECRET', ''),
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Elasticsearch Configuration
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may configure your settings for Elasticsearch, which is a
|
|
||||||
| distributed, open source search and analytics engine. Feel free
|
|
||||||
| to add as many Elasticsearch servers as required by your app.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'elasticsearch' => [
|
|
||||||
'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
|
|
||||||
|
|
||||||
'config' => [
|
|
||||||
'hosts' => [
|
|
||||||
env('ELASTICSEARCH_HOST', 'localhost'),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
'pgsql' => [
|
|
||||||
'connection' => env('DB_CONNECTION', 'pgsql'),
|
|
||||||
// You may want to update index documents directly in PostgreSQL (i.e. via triggers).
|
|
||||||
// In this case you can set this value to false.
|
|
||||||
'maintain_index' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
|
@ -1,155 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Laravel\Telescope\Watchers;
|
|
||||||
use Laravel\Telescope\Http\Middleware\Authorize;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Domain
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This is the subdomain where Telescope will be accessible from. If the
|
|
||||||
| setting is null, Telescope will reside under the same domain as the
|
|
||||||
| application. Otherwise, this value will be used as the subdomain.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'domain' => null,
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Path
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This is the URI path where Telescope will be accessible from. Feel free
|
|
||||||
| to change this path to anything you like. Note that the URI will not
|
|
||||||
| affect the paths of its internal API that aren't exposed to users.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'path' => 'telescope',
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Storage Driver
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This configuration options determines the storage driver that will
|
|
||||||
| be used to store Telescope's data. In addition, you may set any
|
|
||||||
| custom options as needed by the particular driver you choose.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'driver' => env('TELESCOPE_DRIVER', 'database'),
|
|
||||||
|
|
||||||
'storage' => [
|
|
||||||
'database' => [
|
|
||||||
'connection' => env('DB_CONNECTION', 'mysql'),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Master Switch
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option may be used to disable all Telescope watchers regardless
|
|
||||||
| of their individual configuration, which simply provides a single
|
|
||||||
| and convenient way to enable or disable Telescope data storage.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'enabled' => env('TELESCOPE_ENABLED', true),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Route Middleware
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| These middleware will be assigned to every Telescope route, giving you
|
|
||||||
| the chance to add your own middleware to this list or change any of
|
|
||||||
| the existing middleware. Or, you can simply stick with this list.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'middleware' => [
|
|
||||||
'web',
|
|
||||||
Authorize::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Ignored Paths & Commands
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| The following array lists the URI paths and Artisan commands that will
|
|
||||||
| not be watched by Telescope. In addition to this list, some Laravel
|
|
||||||
| commands, like migrations and queue commands, are always ignored.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'ignore_paths' => [
|
|
||||||
//
|
|
||||||
],
|
|
||||||
|
|
||||||
'ignore_commands' => [
|
|
||||||
//
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Telescope Watchers
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| The following array lists the "watchers" that will be registered with
|
|
||||||
| Telescope. The watchers gather the application's profile data when
|
|
||||||
| a request or task is executed. Feel free to customize this list.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'watchers' => [
|
|
||||||
Watchers\CacheWatcher::class => env('TELESCOPE_CACHE_WATCHER', true),
|
|
||||||
|
|
||||||
Watchers\CommandWatcher::class => [
|
|
||||||
'enabled' => env('TELESCOPE_COMMAND_WATCHER', true),
|
|
||||||
'ignore' => [],
|
|
||||||
],
|
|
||||||
|
|
||||||
Watchers\DumpWatcher::class => env('TELESCOPE_DUMP_WATCHER', true),
|
|
||||||
Watchers\EventWatcher::class => env('TELESCOPE_EVENT_WATCHER', true),
|
|
||||||
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
|
|
||||||
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
|
|
||||||
Watchers\LogWatcher::class => env('TELESCOPE_LOG_WATCHER', true),
|
|
||||||
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
|
|
||||||
|
|
||||||
Watchers\ModelWatcher::class => [
|
|
||||||
'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
|
|
||||||
'events' => ['eloquent.*'],
|
|
||||||
],
|
|
||||||
|
|
||||||
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
|
|
||||||
|
|
||||||
Watchers\QueryWatcher::class => [
|
|
||||||
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
|
|
||||||
'ignore_packages' => true,
|
|
||||||
'slow' => 100,
|
|
||||||
],
|
|
||||||
|
|
||||||
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
|
|
||||||
|
|
||||||
Watchers\RequestWatcher::class => [
|
|
||||||
'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
|
|
||||||
'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64),
|
|
||||||
],
|
|
||||||
|
|
||||||
Watchers\GateWatcher::class => [
|
|
||||||
'enabled' => env('TELESCOPE_GATE_WATCHER', true),
|
|
||||||
'ignore_abilities' => [],
|
|
||||||
'ignore_packages' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
|
|
||||||
],
|
|
||||||
];
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('notes', function (Blueprint $table) {
|
||||||
|
DB::statement('DROP INDEX IF EXISTS notes_searchable_index');
|
||||||
|
DB::statement('ALTER TABLE notes DROP searchable');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('notes', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
1777
package-lock.json
generated
1777
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"puppeteer": "^9.1.1"
|
"puppeteer": "^13.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.3",
|
"@babel/core": "^7.12.3",
|
||||||
|
@ -27,8 +27,8 @@
|
||||||
"postcss-loader": "^6.1.1",
|
"postcss-loader": "^6.1.1",
|
||||||
"pre-commit": "^1.1.3",
|
"pre-commit": "^1.1.3",
|
||||||
"stylelint": "^14.2.0",
|
"stylelint": "^14.2.0",
|
||||||
"stylelint-config-standard": "^24.0.0",
|
"stylelint-config-standard": "^25.0.0",
|
||||||
"stylelint-webpack-plugin": "^2.1.1",
|
"stylelint-webpack-plugin": "^3.1.1",
|
||||||
"webpack": "^5.3.2",
|
"webpack": "^5.3.2",
|
||||||
"webpack-cli": "^4.0.0"
|
"webpack-cli": "^4.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html lang="en-GB">
|
<html lang="en-GB">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>@if (App::environment() == 'local'){!! "[testing] -"!!}@endif @yield('title'){{ config('app.display_name') }}</title>
|
<title>@yield('title'){{ config('app.display_name') }}</title>
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<link rel="stylesheet" href="/assets/frontend/normalize.css">
|
<link rel="stylesheet" href="/assets/frontend/normalize.css">
|
||||||
@if (!empty(config('app.font_link')))<link rel="stylesheet" href="{{ config('app.font_link') }}">@endif
|
@if (!empty(config('app.font_link')))<link rel="stylesheet" href="{{ config('app.font_link') }}">@endif
|
||||||
|
@ -48,9 +48,9 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<form action="search" method="get">
|
{{-- <form action="search" method="get">--}}
|
||||||
<input type="text" name="terms" title="Search"><button type="submit">Search</button>
|
{{-- <input type="text" name="terms" title="Search"><button type="submit">Search</button>--}}
|
||||||
</form>
|
{{-- </form>--}}
|
||||||
<p>Built with love: <a href="/colophon">Colophon</a></p>
|
<p>Built with love: <a href="/colophon">Colophon</a></p>
|
||||||
<a href="https://indieweb.org"><img src="/assets/img/iwc.svg" alt="Indie Web Camp logo" class="iwc-logo"></a>
|
<a href="https://indieweb.org"><img src="/assets/img/iwc.svg" alt="Indie Web Camp logo" class="iwc-logo"></a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -183,8 +183,6 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
// Places
|
// Places
|
||||||
Route::get('places', [PlacesController::class, 'index']);
|
Route::get('places', [PlacesController::class, 'index']);
|
||||||
Route::get('places/{place}', [PlacesController::class, 'show']);
|
Route::get('places/{place}', [PlacesController::class, 'show']);
|
||||||
|
|
||||||
Route::get('search', [SearchController::class, 'search']);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Short URL
|
// Short URL
|
||||||
|
|
|
@ -143,7 +143,7 @@ class ContactsTest extends TestCase
|
||||||
$file = fopen(__DIR__ . '/../../aaron.png', 'rb');
|
$file = fopen(__DIR__ . '/../../aaron.png', 'rb');
|
||||||
$mock = new MockHandler([
|
$mock = new MockHandler([
|
||||||
new Response(200, ['Content-Type' => 'text/html'], $html),
|
new Response(200, ['Content-Type' => 'text/html'], $html),
|
||||||
new Response(200, ['Content-Type' => 'iamge/png'], $file),
|
new Response(200, ['Content-Type' => 'image/png'], $file),
|
||||||
]);
|
]);
|
||||||
$handler = HandlerStack::create($mock);
|
$handler = HandlerStack::create($mock);
|
||||||
$client = new Client(['handler' => $handler]);
|
$client = new Client(['handler' => $handler]);
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Tests\Feature;
|
|
||||||
|
|
||||||
use App\Models\Note;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class SearchControllerTest extends TestCase
|
|
||||||
{
|
|
||||||
use RefreshDatabase;
|
|
||||||
|
|
||||||
/** @test */
|
|
||||||
public function searchPageReturnsResult(): void
|
|
||||||
{
|
|
||||||
Note::factory()->create([
|
|
||||||
'note' => 'I love [duckduckgo.com](https://duckduckgo.com)',
|
|
||||||
]);
|
|
||||||
$response = $this->get('/search?terms=love');
|
|
||||||
$response->assertSee('duckduckgo.com');
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue