Question: When starting to work with models I got the following error 

> 
> Class Post not found`. 
> 
> 
> 

All I did:  

- Created a Model with the command `php artisan make:model`  

- Tried to get all entries from table `posts` with `echo Post::all()` 

I used the following code:

**router.php**

```
Route::get('/posts', function(){
    $results = Post::all();
    return $results;
});

```

**Post.php** 

```
<?php 
namespace App;

use Illuminate\Database\Eloquent\Model;

class Post extends Model {
    protected $table = 'posts';    
}

```

What I tried  

- Renaming Class  

- Dump-autoload ([Laravel 4 Model class not found](https://stackoverflow.com/questions/14284472/laravel-4-model-class-not-found))

Answer: 
I had the same issue. It turned out my Post model was in a php file whose name was not Post.php

=> the filename must match the name of your class (Post class in Post.php file)
As @bulk said, it uses namespaces.

I recommend you to start using an IDE, it will suggest you to import all the required namespaces (`\App\Post` in this case).