laravellaravel-5

Missing routes.php File in New Laravel Project


I downloaded Composer, installed Laravel, and started my first Laravel project to begin learning Laravel using the lessons on Laracast (great lessons). Lesson two covers routes. My new project does not have a routes.php file.

I deleted the composer and started again. Same thing. Tried two different computers. Same thing. I was using NetBeans so I tried using PHP Storm. Same thing. I tried making my own routes.php file but it doesn't seem to work right because I know nothing about Laravel at this point. I tried creating and saving the project in htdocs, and then the PHPStorm project folder, but again - no routes.php file.

Composer is saved here- C:\Users\myName\AppData\Roaming\Composer\vendor\bin. I used composer global required "laravel/installer" in the command prompt to install Laravel. Any ideas?


Solution

  • The lastest version of Laravel doesn't have a routes.php file.

    This 'routes.php' file was located in \app\Http in the older versions.

    In the newer version, Laravel 5.3, we have a folder named 'routes', where we can find the following files:

    For this new version, the routes for your controllers, you can put inside web.php file

    See the documentation about routing here

    https://laravel.com/docs/5.3/routing#basic-routing

    The video lesson you are watching may be outdated.