Laravel 5在destroy路径上缺少必需的参数

I recently upgraded from laravel 5.1 to 5.2 and now I'm getting an error of Missing required parameters for [Route: example.destroy] [URI: example/{args}].

The error occurs here: <form class="form-horizontal" action="<?php echo route('example.destroy'); ?>" method="post"> on the action attribute of the form.

Here's how the route was registered on the route.php

Route::resource('example', 'ExampleController');

When I was in 5.1, there was no error with this line. Just went I upgrade to 5.2, it now occurs.

The functionality of this is that it will allow user to delete multiple entries by checking the checkboxes that they wish to be deleted. Then upon submit, it will redirect to the destroy method on the controller.

You can try the following

<form class="form-horizontal" action="<?php echo       
url('example'); ?>" method="post">

Route::post('example', 'ExampleController@destroy');

I had the same problem when updating my app to Laravel 5.2.

Apparently, Laravel 5.2 require a valid Route to "destroy resource", ex:

/my-route/item-to-destroy/{id}

Here, in our apps I'm putting an "{id} = 0" or "{id} = null", at the end of each route (when calling a "route destroy" that is not yet ready).

In your case, it would be similar to that:

<form action="<?php echo route('example_route.destroy', ['id'=>0]); ?>" method="post">

or, declare a valid resource id:

<form action="<?php echo route('example_route.destroy', ['id'=>$object->id]); ?>" method="post">

Try with this:

<form class="form-horizontal" action="<?php echo route('example.destroy', $record->id); ?>" method="post">

or Laravel way:

{!! Form::open(['route' => ['example.destroy', $record->id],
                                                'method' => 'delete']) !!}

{!! Form::close() !!}