0

I'm new to laravel and I have a problem. I'm trying to delete values form web page (values display form database to webpage) but one error occur that is

http://Symfony\Component\HttpKernel\Exception\NotFoundHttpException
…\bootstrap\compiled.php5726

An error code is throw new NotFoundHttpException();

How to solve it?

3 Answers 3

1

First of all, check the route you're looking at exists in your routes.php file. You can also do this through the command line using $ php artisan routes You can narrow it down with say: $ php artisan routes | grep 'route_name'

Then check the route isn't behind a conditional filter. For example if you're using user log-in etc, make sure the route you're after isn't within an authenticated route group.

Sign up to request clarification or add additional context in comments.

Comments

0

This is just Laravel's way of saying "404, file not found" - no route matches the URL (and request method) you're accessing (most likely - maybe you've got a GET route but you're doing a POST?), or your code is doing App::abort(404) somewhere (less likely).

4 Comments

oute::group(array('prefix' =>'/newsandevents'),function() {Route::delete('/newsandevents/delete',array('uses'=>'NewsandeventsController@delete','as'=>'delete')); }); my routes.php
@CNB Route::delete requires following the special instructions at laravel.com/docs/4.2/html#opening-a-form because browsers don't support the DELETE method. Can you show us your Form::open tag?
{{Form::open('newsandevents/delete','DELETE',array('style'=>'display:inline'))}} {{Form::hidden('id',$newsevents->id)}} {{Form::submit('delete')}} {{Form::close()}} is my tag..
@CNB Well, that's your problem. Form::open takes a single parameter, an array, as clearly indicated in the linked documentation. Try Form::open(['url' => 'newsandevents/delete', 'method' => 'delete', 'style' => 'display:inline']); If you view source you should see that your current approach isn't adding the method hidden input nor the style attribute.
0

I just had this issue and it was caused by my route calling the delete method on my controller instead of destroy.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.