如何更改dbfield值onclick图像从(布尔值)0到1

时间:2017-10-20 13:20:47

标签: javascript

以下是我的代码,

 <span><a href="{!! route('approve', ['id' => $user->id]) !!}"><img alt="" 
src="http://school.glwh.org/wp-content/uploads/bigstock-vector-green-
positive-checkmar-16955600.jpg" 
        style="height: 85px; width: 80px" id="imgClickAndChange" 

的onclick =&#34; changeImage()&#34; /&GT;

在控制器中,

public function postApprove($id)
{
     $application = Move::where('id', '=', e($id))->first();
if($application)
{
    $application->approved = 1;
    $application->save();
  return redirect()->route('driver');
}

此coe将dbfield值更改为&#39; 1&#39; onclick但是当另一个点击它时,它的价值就是&#39; 0&#39; 0&#39; 0为此我如何改变我的代码

0 个答案:

没有答案