jonnjo2005
jonnjo2005

Reputation: 85

Routes file not properly loaded

I have just installed a new installation of Laravel using composer as per the laravel docs. The documentation refers to the app/routes.php file which is used to map routes to controllers or closed functions. First, there was no app/routes.php file so I created one. Now the routes I've copied from the laravel documentation aren't being found when accessing via the browser. In fact the app/routes.php file isn't even being found by the application as I have put a die statement in there and nothing. It has nothing to do with .htaccess. I am using the default .htaccess and redirects are working. I thought maybe it has something to do with the composer.json autoload array so I have tested that and nothing. Not a jot. Either I'm being thick or there is something fundamental which isn't being explained in the docs. I'm running the latest version of laravel. Any ideas?

Upvotes: 0

Views: 72

Answers (3)

jonnjo2005
jonnjo2005

Reputation: 85

Basically I did chmod 777 on the storage and vendor files and it started working

Upvotes: 0

user4055330
user4055330

Reputation:

In Laravel 5, the routes file is located elsewhere: app/Http/routes.php.

Upvotes: 1

Tim Lewis
Tim Lewis

Reputation: 29278

Laravel changed the folder structure with its latest release (which is version 5):

  • In 4.2: app/routes.php
  • In 5.0: app/Http/routes.php

There's also a few things you need to do in order for a Laravel Project to work. First (and this is the method I use) create a symbolic link to your project's public folder:

ln -s /path/to/webroot/example_app/public /path/to/webroot/example

Next, change the permissions on your storage folder:

chmod 777 -R storage

You should now be able to access localhost/example and the Laravel 5 welcome page should show up. Usually I call my project example_app and create a link to a folder called example, so I can easily access it via localhost/example

Upvotes: 3

Related Questions