الان من با این قسمتی که برای مدیر نوشتم مشکل دارم . 
کدی که قسمت ادمین برای اضافه کردن محصولات توسط مدیره ، به صورت اجاکس هست . مدیر که اضافه یا کم میکرد (تگ input ازنوع number گزاشتم) با اجاکس تعداد موجودی (اسمشو exist گزاشتم اینجا ) در تیبل محصولات آپدیت میشد . 
این کد قسمت کنترلر هست که جواب میداد
public function productQuantity(Request $request,Product_stocks $product_stocks)
    {
        $quantity = $request->quantity;
        $id = $request->idProduct;
		Product::where('id', $id)->update(array('exist' => $quantity));/
    }
الان سخت شد . نمیدونم چطوری تغییر بدم که هم اجاکس باشه ، هم in و out رو بفهمه .
اینطوری نوشتم کنترلر رو ولی مشکلاتش اینه که اولا تعداد کل موجودی جدید درج میشه در انبارداری ، نه تعدادی که اضافه یا کم شده . و اینکه تو این کد چطوری تمایز قایل بشم که داره in اتفاق میفته یا out .
public function productQuantity(Request $request,Product_stocks $product_stocks)
    {
        $quantity = $request->quantity;
        $id = $request->idProduct;
       
        $input['quantity'] = $quantity;
        $input['product_id'] = $id;
        $input['type'] = "in";
        Product_stocks::create($input);
       // return \response()->json(['quantity'=>$quantity ,'idProduct'=>$id ]);
    }
کد اجاکس :
<script type="text/javascript">
$(document).ready(function() {
        $( ".quantity-add" ).change(function (e) {
            e.preventDefault();
$.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
            var quantity = $(this).val();
            var idProduct = $(this).data('id');
$.ajax({
                url : "{{ url('/admin/products-quantity') }}",
method :'get',
data : {  quantity : quantity , idProduct : idProduct},
success : function(result) {
                    //console.log(result);
                     //alert(result.quantity+result.idProduct);
}
            });
});
});
</script>