jeudi 20 août 2015

Laravel completely ignoring routes.php

I'm using Laravel to create a simple company website. I defined a basic route that should represent my homepage as follows:

<?php

Route::get('/', 'IndexController@index');

This is my index controller:

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\View;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        return View::make('index');
    }

I have ommited the other methods as they haven't been changed after doing php artisan make:controller.

I'm using Bitnami WAPP stack currently. I already have a working second application that I can correctly use(not ignoring its routes.php file). I put this application in a folder in /htdocs.

I start the app by using cmd on Windows to navigate to the folder and then do php artisan serve. When I type in localhost:8000, index.php is loaded, but not through my controller. I tested this by typing die() in the controller method before returning the view(the view is placed in resources/views as index.blade.php). I even tried to echo something from routes.php with no results.

The problem therefore is that the server loads the page, but not through my controller but just serving a file whose name is index.php.

Please, if you need any more info tell me, this is driving me nuts.

laravel php laravel 5 laravel 4 laravel with laravel tutorial

Aucun commentaire:

Enregistrer un commentaire