app/Http/Controllers/ImageCourseController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\ImageCourse  $imageCourse
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $imageCourse = ImageCourse::find($id);
        if (!$imageCourse) {
            return response()->json([
                "status" => "error",
                "message" => "image not found"
            ], 404);
        }
        $imageCourse->delete();
        return response()->json([
            "status" => "success",
            "message" => "image deleted"
        ]);
    }
public function destroy ( $ id ) { $ imageCourse = ImageCourse :: find ( $ id ) ; if ( ! $ imageCourse ) { return response ( ) -> json ( [ " status " => " error " , " message " => " image not found " ] , 404 ) ; } $ imageCourse -> delete ( ) ; return response ( ) -> json ( [ " status " => " success " , " message " => " image deleted " ] ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .