0

Greetings im new in laravel and i want to learn how to show the html page in laravel.

My laravel's location is: C:/wamp/www/laravel

The location of the page that i want to view: C:/wamp/www/laravel/app/views/hello.php

I tried localhost/wamp/www/laravel/app/views/hello.php but it only gives me an error:

The requested URL /wamp/www/laravel/app/views/hello.php was not found on this server.

3
Contributors
5
Replies
31
Views
3 Years
Discussion Span
Last Post by Sam.Samual
0

did you try localhost/laravel/hello

The hello should be defined as route.

For example, if we have a controller as shown below. I did not test this, because I don't have any laravel on my development server at the moment.So, most of the codes below are coming out of my head as I type this response. However, your codes should be pretty similar to this.

hello controller

<?php

    class HelloController extends BaseController{

            public function sayHello(){

                $message = 'hello world';
                return View::make('hello', array('message' => $message));

            } 
     }

the above controller can be routed like this

Route::get('hello', 'HelloController@sayHello');

the route above will allow you to access localhost/laravel/hello

there is another way creating a route in Laravel, but I can't remember them right now.

Edited by veedeoo: info added.

0

Still the same error :/.

The requested URL /laravel/hello was not found on this server.

0

can post your router codes for this page? It should be located in app/routes.php.

Can post your controller for this page?
How about the view file?

MVC is easy to figure out. The uri[1] is always the controller or at least a controller has something to do with it. e.g. localhost/installation_dir/controller_name_OR_router_definition/_controller_method/

By the way, how did you install laravel? Did you use composer?

Edited by veedeoo: info added.

0

can you try, localhost/laravel/public to see if you can view the welcome page?

for xampp, you need to change this

filename: laravel/app/config/app.php

look for this code

'url' => 'http://localhost/',

change it to

'url' => 'http://localhost/laravel/',

save your changes and direct your browser to

localhost/laravel/public/

you should be able to view the welcome page

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.