mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
Remove search for now, increase upload filesize limits
This commit is contained in:
parent
1442dbfa60
commit
cb086c4708
21 changed files with 117 additions and 244 deletions
13
app/Livewire/App/Pagination.php
Normal file
13
app/Livewire/App/Pagination.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\App;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class Pagination extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.app.pagination');
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,6 @@ class Users extends Component
|
|||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.pages.users', [ 'users' => User::all() ]);
|
||||
return view('livewire.pages.users', [ 'users' => User::paginate(10) ]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
namespace App\Livewire\Posts;
|
||||
|
||||
use App\Models\Post;
|
||||
use App\Models\Tag;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Attributes\Url;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
|
|
@ -14,7 +16,7 @@ class Index extends Component
|
|||
#[Title('Posts')]
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.posts.index', [
|
||||
return view('livewire.posts.index', [
|
||||
'posts' => Post::orderBy('created_at', 'desc')->paginate(25),
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Spatie\Searchable\ModelSearchAspect;
|
||||
use Spatie\Searchable\Search as SpatieSearch;
|
||||
|
||||
class Search extends Component
|
||||
{
|
||||
#[Validate('string|min:3')]
|
||||
public string $searchText = '';
|
||||
|
||||
public $searchResults = [];
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.search');
|
||||
}
|
||||
|
||||
public function updated()
|
||||
{
|
||||
$this->searchResults = (new SpatieSearch())
|
||||
->registerModel(User::class, 'name')
|
||||
->perform($this->searchText);
|
||||
}
|
||||
}
|
||||
13
app/Livewire/Tags/View.php
Normal file
13
app/Livewire/Tags/View.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Tags;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class View extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.tags.view');
|
||||
}
|
||||
}
|
||||
|
|
@ -5,8 +5,6 @@ namespace App\Models;
|
|||
use MongoDB\Laravel\Eloquent\Model;
|
||||
use MongoDB\Laravel\Relations\BelongsTo;
|
||||
use MongoDB\Laravel\Relations\BelongsToMany;
|
||||
use MongoDB\Laravel\Relations\HasMany;
|
||||
use MongoDB\Laravel\Relations\MorphToMany;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ use Laravel\Sanctum\HasApiTokens;
|
|||
use MongoDB\Laravel\Auth\User as Authenticatable;
|
||||
use MongoDB\Laravel\Relations\HasMany;
|
||||
use Overtrue\LaravelFavorite\Traits\Favoriter;
|
||||
use Spatie\Searchable\Searchable;
|
||||
use Spatie\Searchable\SearchResult;
|
||||
|
||||
class User extends Authenticatable implements Searchable
|
||||
class User extends Authenticatable
|
||||
{
|
||||
protected $connection = 'mongodb';
|
||||
protected $table = 'users';
|
||||
|
|
@ -48,16 +46,6 @@ class User extends Authenticatable implements Searchable
|
|||
return $this->hasMany(Comment::class);
|
||||
}
|
||||
|
||||
public function getSearchResult(): SearchResult
|
||||
{
|
||||
$url = url("/profiles/$this->id");
|
||||
return new SearchResult(
|
||||
$this,
|
||||
$this->name,
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
public function getAvatarBase64(): string
|
||||
{
|
||||
$ext = $this->avatar_ext;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue