Upgrade to Laravel 9 (#252)
This commit is contained in:
parent
16a4d89d18
commit
78bd468d3d
28 changed files with 2275 additions and 3466 deletions
|
|
@ -138,8 +138,8 @@ class ContactsController extends Controller
|
|||
}
|
||||
$mf2 = \Mf2\parse((string) $response->getBody(), $contact->homepage);
|
||||
foreach ($mf2['items'] as $microformat) {
|
||||
if (Arr::get($microformat, 'type.0') == 'h-card') {
|
||||
$avatarURL = Arr::get($microformat, 'properties.photo.0');
|
||||
if (Arr::get($microformat, 'type.0') === 'h-card') {
|
||||
$avatarURL = Arr::get($microformat, 'properties.photo.0.value');
|
||||
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;
|
||||
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
|
|
@ -19,5 +19,10 @@ class TrustProxies extends Middleware
|
|||
*
|
||||
* @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;
|
||||
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
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\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\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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
@ -105,12 +66,13 @@ class Article extends Model
|
|||
*/
|
||||
public function getHtmlAttribute(): string
|
||||
{
|
||||
$environment = Environment::createCommonMarkEnvironment();
|
||||
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||
$environment->addBlockRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||
$commonMarkConverter = new CommonMarkConverter([], $environment);
|
||||
$environment = new Environment();
|
||||
$environment->addExtension(new CommonMarkCoreExtension());
|
||||
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||
$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;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
|
|
|||
|
|
@ -4,36 +4,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace App\Models;
|
||||
|
||||
use App\Traits\FilterHtml;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -13,28 +12,6 @@ use Illuminate\Support\Arr;
|
|||
use Illuminate\Support\Carbon;
|
||||
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
|
||||
{
|
||||
use FilterHtml;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -12,34 +11,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||
use Illuminate\Support\Carbon;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
|
@ -12,26 +11,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -10,92 +10,22 @@ use Codebird\Codebird;
|
|||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Database\Eloquent\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany};
|
||||
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model, SoftDeletes};
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Database\Eloquent\{Builder, Factories\HasFactory, Model, SoftDeletes};
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
use Jonnybarnes\IndieWeb\Numbers;
|
||||
use Laravel\Scout\Searchable;
|
||||
use League\CommonMark\Block\Element\{FencedCode, IndentedCode};
|
||||
use League\CommonMark\Environment\Environment;
|
||||
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 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
|
||||
{
|
||||
use HasFactory;
|
||||
use Searchable;
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
|
|
@ -597,13 +527,14 @@ class Note extends Model
|
|||
*/
|
||||
private function convertMarkdown(string $note): string
|
||||
{
|
||||
$environment = Environment::createCommonMarkEnvironment();
|
||||
$environment = new Environment();
|
||||
$environment->addExtension(new CommonMarkCoreExtension());
|
||||
$environment->addExtension(new AutolinkExtension());
|
||||
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||
$environment->addBlockRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||
$converter = new CommonMarkConverter([], $environment);
|
||||
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer());
|
||||
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer());
|
||||
$markdownConverter = new MarkdownConverter($environment);
|
||||
|
||||
return $converter->convertToHtml($note);
|
||||
return $markdownConverter->convert($note)->getContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,50 +5,11 @@ declare(strict_types=1);
|
|||
namespace App\Models;
|
||||
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
|
||||
use Illuminate\Support\Carbon;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
|
@ -13,26 +12,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|||
use Illuminate\Support\Carbon;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
|
@ -13,28 +12,6 @@ use Illuminate\Notifications\DatabaseNotificationCollection;
|
|||
use Illuminate\Notifications\Notifiable;
|
||||
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
|
||||
{
|
||||
use HasFactory;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ namespace App\Models;
|
|||
|
||||
use App\Traits\FilterHtml;
|
||||
use Codebird\Codebird;
|
||||
use Eloquent;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
|
@ -17,42 +16,6 @@ use Illuminate\Support\Facades\Cache;
|
|||
use Jonnybarnes\WebmentionsParser\Authorship;
|
||||
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
|
||||
{
|
||||
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-json": "*",
|
||||
"ext-dom": "*",
|
||||
"cviebrock/eloquent-sluggable": "^8.0",
|
||||
"fideloper/proxy": "~4.0",
|
||||
"cviebrock/eloquent-sluggable": "^9.0",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"indieauth/client": "^1.1",
|
||||
|
|
@ -22,19 +21,16 @@
|
|||
"jonnybarnes/indieweb": "~0.2",
|
||||
"jonnybarnes/webmentions-parser": "~0.5",
|
||||
"jublonet/codebird-php": "4.0.0-beta.1",
|
||||
"laravel/framework": "^8.0",
|
||||
"laravel/framework": "^9.0",
|
||||
"laravel/horizon": "^5.0",
|
||||
"laravel/scout": "^8.0",
|
||||
"laravel/telescope": "^4.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"lcobucci/jwt": "^4.0",
|
||||
"league/commonmark": "^1.0",
|
||||
"league/flysystem-aws-s3-v3": "^1.0",
|
||||
"league/commonmark": "^2.0",
|
||||
"league/flysystem-aws-s3-v3": "^3.0",
|
||||
"mf2/mf2": "~0.3",
|
||||
"pmatseykanets/laravel-scout-postgres": "^7.3",
|
||||
"predis/predis": "~1.0",
|
||||
"spatie/browsershot": "~3.0",
|
||||
"spatie/commonmark-highlighter": "^2.0",
|
||||
"spatie/commonmark-highlighter": "^3.0",
|
||||
"tgalopin/html-sanitizer": "^1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
@ -44,7 +40,7 @@
|
|||
"fakerphp/faker": "^1.9.2",
|
||||
"laravel/dusk": "^6.0",
|
||||
"mockery/mockery": "^1.0",
|
||||
"nunomaduro/collision": "^5.0",
|
||||
"nunomaduro/collision": "^6.1",
|
||||
"phpunit/php-code-coverage": "^9.2",
|
||||
"phpunit/phpunit": "^9.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\RouteServiceProvider::class,
|
||||
App\Providers\HorizonServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ return [
|
|||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'schema' => 'public',
|
||||
'search_path' => 'public',
|
||||
'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,
|
||||
],
|
||||
|
||||
];
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue