commit
7d1738964a
56 changed files with 3869 additions and 4679 deletions
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
|
|
@ -21,6 +21,12 @@ jobs:
|
||||||
- name: 🌎 Set Environment Variables Part 2
|
- name: 🌎 Set Environment Variables Part 2
|
||||||
run: |
|
run: |
|
||||||
echo "newReleaseDir=${{ env.releasesDir }}/${{ env.newReleaseName }}" >> $GITHUB_ENV
|
echo "newReleaseDir=${{ env.releasesDir }}/${{ env.newReleaseName }}" >> $GITHUB_ENV
|
||||||
|
- name: 🔀 Get Branch
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
||||||
|
- name: 🔍 Check Branch
|
||||||
|
run: echo "${{ env.branch }}"
|
||||||
- name: 🔄 Clone Repository
|
- name: 🔄 Clone Repository
|
||||||
uses: appleboy/ssh-action@master
|
uses: appleboy/ssh-action@master
|
||||||
with:
|
with:
|
||||||
|
|
@ -39,7 +45,7 @@ jobs:
|
||||||
mkdir ${{ env.newReleaseDir }}
|
mkdir ${{ env.newReleaseDir }}
|
||||||
|
|
||||||
# Clone app
|
# Clone app
|
||||||
git clone --depth 1 --branch main https://github.com/${{ env.repository }} ${{ env.newReleaseName }}
|
git clone --depth 1 --branch ${{ env.branch }} https://github.com/${{ env.repository }} ${{ env.newReleaseName }}
|
||||||
|
|
||||||
# Mark release
|
# Mark release
|
||||||
cd ${{ env.newReleaseDir }}
|
cd ${{ env.newReleaseDir }}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ use App\Models\Place;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
class MigratePlaceDataFromPostgis extends Command
|
class MigratePlaceDataFromPostgis extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@ class Kernel extends ConsoleKernel
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
* @return void
|
* @return void
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
$schedule->command('horizon:snapshot')->everyFiveMinutes();
|
$schedule->command('horizon:snapshot')->everyFiveMinutes();
|
||||||
$schedule->command('telescope:prune --hours=48')->daily();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,6 +4,9 @@ namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
class Authenticate extends Middleware
|
class Authenticate extends Middleware
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
class RedirectIfAuthenticated
|
class RedirectIfAuthenticated
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
class TrustHosts extends Middleware
|
class TrustHosts extends Middleware
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class ProcessLike implements ShouldQueue
|
||||||
|
|
||||||
//POSSE like
|
//POSSE like
|
||||||
try {
|
try {
|
||||||
$response = $client->request(
|
$client->request(
|
||||||
'POST',
|
'POST',
|
||||||
'https://brid.gy/publish/webmention',
|
'https://brid.gy/publish/webmention',
|
||||||
[
|
[
|
||||||
|
|
@ -70,8 +70,8 @@ class ProcessLike implements ShouldQueue
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} catch (RequestException $exception) {
|
} catch (RequestException) {
|
||||||
//no biggie
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue