找不到“帖子”类

Trying to delete data from database. But "Class not found" error showing. Here is my code for the delete.

Route::get('/delete', function (){

    $post = Post::find(1);
    $post->delete();

});

This is my post class

The HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently. Of those less-frequent methods, OPTIONS and HEAD are used more often than others.

Deleting a resource should be done using The DELETE HTTP Verb.

in your case:

//include your posts model.
use App\Post; 

Route::delete('/delete/{id}', function ($id){

    $post = Post::findOrFail($id);
    $post->delete();

});

PS. you might consider implementing your app logic inside separate controllers instead of using your routes file.