1

I'm trying to make a test controller, i read its documentation and following the instruction during developer controller and view. But it does not working.

Controller

project/app/http/controllers/TestController.php

<?php 

namespace App\Http\Controllers;

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

class TestController extends Controller {

    /**
     * Show the profile for the given user.
     *
     * @param  int  $id
     * @return Response
     */
    public function index()
    {
        return view('test');
    }

}
?>

Route

Route::get('test', 'TestController@index');

View

project/resources/views/test.blade.php

simple html

I'm testing this controller using http://localhost/project/public/test but it does not work. Can any one guide me where i'm wrong.

Ayaz Ali Shah
  • 3,453
  • 9
  • 36
  • 68

1 Answers1

0

Use this in your view <a src="{{ route('test') }}">test</a>

Fester
  • 863
  • 1
  • 12
  • 33
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/11134711) – Jeff Feb 03 '16 at 21:31
  • @jeff yes it does, it's a matter of him accessing the wrong url from his view. I showed how to echo the right url – Fester Feb 04 '16 at 07:18