app/Http/Controllers/DashboardPostController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Post  $post
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Post $post)
    {
        if($post->image){
            Storage::delete($post->image);
        }
        Post::destroy($post->id);
        return redirect('dashboard/posts')->with('success', 'Delete Success');
    }
public function destroy ( Post $ post ) { if ( $ post -> image ) { Storage :: delete ( $ post -> image ) ; } Post :: destroy ( $ post -> id ) ; return redirect ( 'dashboard/posts' ) -> with ( 'success' , 'Delete Success' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .