I'm hesitant to comment on the method below:
public function index()
{
$posts = Post::orderBy('created_at', 'desc')->paginate(10);
return view('painel.post.listar', compact('posts'));
}
It would be correct to comment this way:
/**
* Retorna uma instância de View
*
* @return object
*/
public function index()
{
$posts = Post::orderBy('created_at', 'desc')->paginate(10);
return view('painel.post.listar', compact('posts'));
}
Or the return would be View and in the description instead of " Return an instance of View " would be "Return an object" / p>