<?php

namespace Modules\Admin\Http\Livewire;

use Livewire\Component;

use Modules\Post\Models\Post;
class Posts extends Component
{
    public $userId;
    public function mount()
    {
        $this->userId = auth()->user()->id;
    }

    public function open($id)
    {
        $this->dispatch('showPostCardInModal', id: $id);
    }
    public function render()
    {
        $posts = Post::all();
        return view('admin::posts.list', [
            'posts' => $posts
        ]);
    }
}