路线返回视图给出错误Laravel 5

I am getting returning string from that checkCookie controller class method. So why this snippet gives me error??

Route::get('mypage',function(Request $request){
    $a=new App\Http\Controllers\indexController;
    $b=$a->checkCookie($request);
    if(!empty($b)){
        return view('mypage');
    }
});

i found the solution (https://laracasts.com/discuss/channels/general-discussion/laravel-5-php-artisan-migrate-problem?page=1). so i have changed my .env file settings equal to config/database.php now my .env file look like:

DB_HOST=localhost
DB_DATABASE='db_name'
DB_USERNAME='root'
DB_PASSWORD=''
DB_PORT=3306