better image uploading & user roles
Some checks failed
Docker / build (push) Has been cancelled

This commit is contained in:
yuriko 🦊 2025-08-09 23:01:27 -04:00
parent 21e59d775a
commit f60ae41bf6
26 changed files with 741 additions and 70 deletions

View file

@ -3,9 +3,7 @@
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;
@ -13,11 +11,20 @@ class Index extends Component
{
use WithPagination;
public $posts = [];
public function mount()
{
$this->posts = Post::orderBy('created_at', 'desc')->get();
}
#[Title('Posts')]
public function render()
{
return view('livewire.posts.index', [
'posts' => Post::orderBy('created_at', 'desc')->paginate(25),
]);
if ($this->posts->count() == 0)
{
return view('livewire.posts.index-empty');
}
return view('livewire.posts.index');
}
}