如何在Laravel框架中正确设置路由和其他配置并从书中运行代码示例?

I am trying to run the code from a book "Laravel blueprints", chapter 4: "Personal blog" on Laragon and Bitnami Laravel stacks.

I put all the controllers, views, models and routes in respective app folder, set up database so it shows connection and tables migrated, however, when I want to run home page, it says: "Post class not found". I can`t return the home view of the blog. Please help: what I have missed in configurations, how to run examples from book on Laragon and Bitnami Laravel, what files to copy, what remain unchanged and what to configure? Thanks

 <?php



class PostsController extends BaseController{



public function getIndex()

{

    $posts = Posts::with('Author')->orderBy('id', 'DESC')->paginate(5);

    return View::make('index')

            ->with('posts',$posts);

}



public function getAdmin()

{

    return View::make('addpost');

}

public function postAdd()

{

    Posts::create(array(

           'title' => Input::get('title'),

           'content' => Input::get('content'),

           'author_id' =>  Auth::user()->id

       ));



       return Redirect::route('index');

}

} -

class Post extends Eloquent {

//the variable that sets the table name

   protected $table = 'posts';



   //the variable that sets which columns can be edited

   protected $fillable = array('title','content','author_id');




   public $timestamps = true;



   public function Author(){



    return $this->belongsTo('User','author_id');

   }

}

 <?php

/* |--------------------------------------------------------------------------

 Route::get('/', array('as' => 'index', 'uses' =>
'PostsController@getIndex')); Route::get('/admin', array('as' =>
'admin_area', 'uses' => 'PostsController@getAdmin'));
Route::post('/add', array('as' => 'add_new_post', 'uses' =>
'PostsController@postAdd')); Route::post('/login', array('as' =>
'login', 'uses' => 'UsersController@postLogin'));
 Route::get('/logout', array('as' => 'logout', 'uses' =>
'UsersController@getLogout'));

Looks like a namespacing error, I had struggle with it at the beggining too.

Please show us you Post class code, your routes.php file and the controller that is throwing the error.

Actually before doing this, change all places in script where you use Post:: for \App\Post::