删除不在laravel 5.2中工作

时间:2016-11-02 19:23:21

标签: laravel-5.2

我很困惑为什么我的删除无效。 我的route

Route::get('/delete-works/{id}/', [
'uses' => 'WorksController@getDeleteWorks',
'as' => 'Works.delete',
'middleware' => 'auth'
]);

我的controller

public function getDeleteWorks(Request $request, $id)
    {
        $class_id  = $request->get('class_id');

        $works = assainments::where('id', $id)->first();

        $works->delete();

        Flash::success('Successfuly deleted!');
        return redirect(route('works',['class_id'=>$class_id]));

    } 

我的view link

<a href="{{ route('Works.delete', ['class_id'=>$class_id,'id' => $works->id]) }}" ><i class="fa fa-trash"></i></a>

现在它显示空白页面。不显示任何error

0 个答案:

没有答案