My Routes are Returning a 404, How can I Fix Them?

前端 未结 18 1129
栀梦
栀梦 2020-12-23 10:44

I\'ve just started learning the Laravel framework and I\'m having an issue with routing.

The only route that\'s working is the default home route that\'s attached to

18条回答
  •  Happy的楠姐
    2020-12-23 11:33

    you must be using Laravel 5 the command

      class User_Controller extends Controller {
      public $restful = true;
      public function get_index(){
      return View('user.index');
      }
      }
    

    and in routes.php

      Route::get('/', function()
      {
      return view('home.index');
      });
    
      Route::get('user', function()
      {
      return view('user.index');
      });
    

    Laravel 5 command changes for view and controller see the documentation i was having same error before

提交回复
热议问题