Laravel json does not return response

I am Trying to return response from my controller . But this is not working . Here is my ajax. $(‘#pincode’).on(‘change’, function() { //const formData = $(‘#formid’).serializeArray(); var address = $(“input[name=address]”).val(); var pincode= $(“input[name=pincode]”).val(); var price = $(“input[name=price]”).val(); var city = $(“input[name=city]”).val(); var country =$(‘#country’).val(); var state = $(‘#state’).val(); //var state =$(this).val(); //console.log(formData); $.ajaxSetup({ headers:…

How to remove/update single value from array in the database in laravel 6?

Currently I have a collumn called userIds in my database which is an array. I want to be able to update/remove a single value from that array but the methods I have tried has not worked. Controller public function removeUser(Request $request) { $scrumId = $request->scrumId; $userId = $request->userId; DB::table(‘scrumboards’)->where(‘userIds’, $userId)->delete(); return redirect()->back(); } How would…

Laravel find records between two dates

i am doing below coding for find records between two dates in laravel but its not giving today’s created_at records $start_date = date(‘Y-m-d’, strtotime($request->get(‘start_date’))); $end_date = date(‘Y-m-d’, strtotime($request->get(‘end_date’))); $shipments = Shipments::with([‘pick_up_address’, ‘delivery_address’, ’empty_return’, ’empty_pick_up’])->get(); if($request->has(‘start_date’) && $request->has(‘end_date’)) { $shipments = $shipments->where(‘created_at’, ‘<=’, $end_date)->where(‘created_at’, ‘>=’, $start_date); } else if($request->has(‘start_date’)) { $shipments = $shipments->where(‘created_at’, ‘>=’, $start_date); }…

save array in controller laravel

ErrorException Array to string conversion $presocio = new Presocio; $presocio->prestamo_id = $request->prestamo_id; $presocio->ncuota = $request->ncuota; $presocio->montopag = $request->montopag; $presocio->fechapag = $request->fechapag; $presocio->save(); How do I apply array on my controller to save data. Thanks. This is my blade form, inside it I have my table to add rows with jquery. send the array without problems…

Passing data from Laravel to vue

I’m trying to pass an array from the laravel controller to my vue component, there is data already being passed successfully but i’m trying to send another one and this new one isn’t working. This is the controller function, if I dd($data); the correct data is shown. $data[‘user’] = Auth::user()->load(‘userType’); $data[‘courses’] = Course::all(); $data[‘myClasses’] =…

Passing data from Laravel to vue

I’m trying to pass an array from the laravel controller to my vue component, there is data already being passed successfully but i’m trying to send another one and this new one isn’t working. This is the controller function, if I dd($data); the correct data is shown. $data[‘user’] = Auth::user()->load(‘userType’); $data[‘courses’] = Course::all(); $data[‘myClasses’] =…

Passing data from Laravel to vue

I’m trying to pass an array from the laravel controller to my vue component, there is data already being passed successfully but i’m trying to send another one and this new one isn’t working. This is the controller function, if I dd($data); the correct data is shown. $data[‘user’] = Auth::user()->load(‘userType’); $data[‘courses’] = Course::all(); $data[‘myClasses’] =…