Reputation: 2662
I can't get my Laravel app to load any views. I keep getting this error:
InvalidArgumentException
View [index] not found.
I am sure that the view exists, and It's just view loading, so I have no idea what could go wrong.
This is the controller method's code:
public function getIndex()
{
// Get all the blog posts
$posts = $this->post->orderBy('created_at', 'DESC')->paginate(10);
// Show the page
return View::make('site/blog/index', compact('posts'));
}
Upvotes: 0
Views: 1966
Reputation: 152860
Laravel searches for views in the directory (or directories) that is configured in the view.php config file. (Default location: app/config/view.php
)
Attention: The default value uses the __DIR__
variable to specify a relative path. So when you move the file or copy it for an environmental config directory (in the OP's case 'development') you have the change the path accordingly.
Upvotes: 1