<?php
require "../../bootstrap.php";
use Backend\Model\Post;
header('Content-Type: application/json;charset=UTF-8');
if(isset($_POST['id']))
$data = Post::find($_POST['id']);
else
$data = Post::all();
echo $data;