Je sais plus
This commit is contained in:
parent
7416cf37ec
commit
b15ab7fd07
|
@ -44,6 +44,13 @@ class ImagesController extends BaseController
|
|||
return response()->json($image);
|
||||
}
|
||||
|
||||
public function delete($id) {
|
||||
$image = Image::findOrFail($id);
|
||||
$image->delete();
|
||||
|
||||
return response()->json("Delete ".$id." succesfully");
|
||||
}
|
||||
|
||||
private function getOriginal($filename)
|
||||
{
|
||||
$path = $this->getImagePathOrAbort($filename);
|
||||
|
|
|
@ -52,6 +52,10 @@ class ImagesServiceProvider extends ServiceProvider
|
|||
$router->get('images/{filename}', [
|
||||
'as' => 'getPicture', 'uses' => 'ImagesController@get'
|
||||
]);
|
||||
|
||||
$router->delete('images/{id}', [
|
||||
'as' => 'deletePicture', 'uses' => 'ImagesController@delete'
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue