0

I am making basic route with controller but it doesnt work, I dont know why... Earyer worked for me but now doesnt...

Here is routes.php:

Route::get('/admin', array(
   'as' => 'admin-login',
   'uses' => 'AdminController@getAdminLogin'
));

Here is AdminController.php:

class AdminController extends BaseController {

  public function getAdminLogin()
  {
    return View::make('admin.index');
  }
}

When I type localhost/project/public/admin... It goes to localhost/admin Why?

2
  • Is it possible that you entered localhost/project/public/admin/ with a trailing slash? Commented Nov 2, 2014 at 21:16
  • Hmm, well it could be many things... Probably the easiest way to fix it is by either using Laravel's webserver as Mustafa Ehsan mentioned or creating a virtual host for your probject so you can e.g. enter project.dev/admin Commented Nov 3, 2014 at 9:06

1 Answer 1

3

Why don't you use Laravel's own Web Server:

php artisan serve

And then, try this:

http://localhost:8000/admin/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.