Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

Can you post your routes.php file and your associated controller code?

Last updated 2 years ago.
0

of course,

Here the routes.php


<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function(){
    return "All cats";
});

Route::get('cats/{id}', function($id){
     return "Cat #$id";
});

and here is the controller :


class HomeController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| Default Home Controller
	|--------------------------------------------------------------------------
	|
	| You may wish to use controllers instead of, or in addition to, Closure
	| based routes. That's great! Here is an example controller method to
	| get you started. To route to this controller, just add the route:
	|
	|	Route::get('/', 'HomeController@showWelcome');
	|
	*/

	public function showWelcome()
	{
		return View::make('hello');
	}

}

I hope I have the right controller. The books is not talking about controllers yet.

Roelof

Last updated 2 years ago.
0

Try calling

<rooturl>/cats/123

Last updated 2 years ago.
0

The requested URL /cats/123 was not found on this server.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.