I'm beginner in Laravel and when I'm trying to use Controller I'm getting this error
Illuminate\Contracts\Container\BindingResolutionException Target class [PostsController] does not exist. http://127.0.0.1:8000/posts
routes directory contain web.php to route and there I'm using
Route::get('/posts', 'PostsController@index');
to redirect to the class PostsController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PostsController extends Controller
{
public function index() {
echo "asdas";
}
}