<?php

namespace Modules\Post\Http\Controllers;

use Modules\Post\Models\Post;
use Modules\Post\Models\PostCategory;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

class PostController extends Controller
{

    public function index(Request $request)
    {
        return view('post::index', [
            'categories' => PostCategory::cases(),
            'filter'     => $request->filter ? $request->filter : []
        ]);
    }

    public function open(Post $post)
    {
        return view('post::list.card', [
            'post' => $post
        ]);
    }
    public function create() {
        return view('post::form.create');
    }
}
