app/Http/Controllers/Admin/BlogController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Blog  $blog
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Blog $blog)
    {
        if(!empty($blog->blog_image)){
            if(file_exists(public_path('storage/blog/' . $blog->blog_image))){
                unlink(public_path('storage/blog/' . $blog->blog_image));
            }
        }
        $blog->delete();
        return redirect(route('admin.blog.index'))->with('success','Blog successfully Delete.');
    }
public function destroy ( Blog $ blog ) { if ( ! empty ( $ blog -> blog_image ) ) { if ( file_exists ( public_path ( 'storage/blog/' . $ blog -> blog_image ) ) ) { unlink ( public_path ( 'storage/blog/' . $ blog -> blog_image ) ) ; } } $ blog -> delete ( ) ; return redirect ( route ( 'admin.blog.index' ) ) -> with ( 'success' , 'Blog successfully Delete.' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .