Laravel URL路由获取2参数

Laravel URL路由获取2参数,laravel,laravel-4,laravel-routing,Laravel,Laravel 4,Laravel Routing,我需要从相册中删除一张照片,所以我想我需要2个路由参数 但我有一些错误,请给我解决方案或其他方式删除相册中的照片 以下是my Routes.php: Route::get('/admin/album/{albumid}/{id}/delete-photo', array( 'as' => 'admin-photo-delete', 'uses' => 'GalleryController@deletePhoto' )); 并在GalleryController上调用

我需要从相册中删除一张照片,所以我想我需要2个路由参数 但我有一些错误,请给我解决方案或其他方式删除相册中的照片

以下是my Routes.php:

Route::get('/admin/album/{albumid}/{id}/delete-photo', array(
    'as' => 'admin-photo-delete',
    'uses' => 'GalleryController@deletePhoto'
));
并在GalleryController上调用函数deletePhoto,以下是GalleryController:

public function deletePhoto($albumID,$photoID){
$photo = Album::find($albumID)->photo()->where('id','=',$photoID)->get();
if($photo){
    File::delete(public_path().'/assets/images/gallery/'.$photo->images);
    $photo->delete();
    return Redirect::route('admin-gallery')->with('message','Photo was deleted successfully');
}
return Redirect::route('admin-gallery')->with('message','Photo delete failed');}
以下是我如何称呼路线:

 <a href="{{URL::route('admin-photo-delete',$id,$photo->id)}}">Delete Photo</a>
我已经确保$id和$photo->id不为null,但看到哪个url显示没有第二个参数值,所以我得到一些错误: 在URL::route中,应使用数组作为第二个参数,如下所示:

<a href="{{URL::route('admin-photo-delete', [$id, $photo->id] )}}">Delete Photo</a>

在URL中,“删除照片”前有2个反斜杠