"NotFoundHttpException" means that Laravel could not find the route for the request.
Your desc route is just a POST route, and link_to_action will create a GET request, so you may need to change the addition of the GET route too:
Route::post('desc', array('uses' => ' CarController@show ')); Route::get('desc', array('uses' => ' CarController@show '));
There is also any that does GET, POST, PUT, DELETE:
Route::any('desc', array('uses' => ' CarController@show '));
If you need to get id from your route, you will have to add it as a parameter:
Route::post('car/{id}', array('uses' => ' CarController@show '));
And you will have to access your page as:
http://myappt.al/public/car/22
But if you want to access it like:
http:
You will need to do:
Route::post('{id}', array('uses' => ' CarController@show '));
But this is dangerous because it can capture all the routes, so you MUST set it as the most recent route .
And your controller should accept this parameter:
class CarController extends Controller { public function show($id) { dd("I received an ID of $id"); } }
EDIT:
Since you use most of your routes manually, you can also go with the index as follows:
Route::resource('create', 'DataController'); Route::get('/', ' CarController@index '); Route::post('create', array('uses' => ' CarController@create ','uses' => ' DataController@index ')); Route::post('update', array('uses' => ' CarController@update ')); Route::post('store', array('store' => ' CarController@store ')); Route::get('{id}', array('uses' => ' CarController@show ')); Route::post('{id}', array('uses' => ' CarController@show '));