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-03 10:50:28 +00:00
|
|
|
if(isset($_GET['delete_id'])){
|
|
|
|
$id = $_GET['delete_id'];
|
2021-06-02 07:23:08 +00:00
|
|
|
$findId = Post::query()->findOrFail($id);
|
|
|
|
if(!$findId->delete()){
|
2021-06-03 10:50:28 +00:00
|
|
|
return "Error could not delete";
|
2021-06-02 07:23:08 +00:00
|
|
|
}else{
|
2021-06-03 10:50:28 +00:00
|
|
|
return "Record deleted";
|
2021-06-02 07:23:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|