2021-06-02 07:01:51 +00:00
|
|
|
<?php
|
2021-06-02 07:23:08 +00:00
|
|
|
|
2021-06-03 10:50:28 +00:00
|
|
|
require "accessControl.php";
|
2021-06-02 07:23:08 +00:00
|
|
|
require "../../bootstrap.php";
|
|
|
|
|
|
|
|
use Backend\Model\Post;
|
|
|
|
|
2021-06-07 13:01:28 +00:00
|
|
|
if(isset($_POST['delete_id'])){
|
|
|
|
$id = $_POST['delete_id'];
|
2021-06-02 07:23:08 +00:00
|
|
|
$findId = Post::query()->findOrFail($id);
|
|
|
|
if(!$findId->delete()){
|
2021-06-08 07:07:58 +00:00
|
|
|
return 0;
|
2021-06-02 07:23:08 +00:00
|
|
|
}else{
|
2021-06-08 07:07:58 +00:00
|
|
|
return 1;
|
2021-06-02 07:23:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|