Laravel/Ajax passing data to controller: data is null

I am trying to pass two variables to my controller using ajax. There are no errors but the data is null when I get it in the controller. Web.php Route::get(‘/donate/select-card’, ‘CardController@chooseCard’)->name(‘select-card’); CardController.php public function chooseCard() { $from = Input::get(“fromAmount”); // $to = $request->input(‘toAmount’); dd($from); } ‘null’ is the output here Script.js fromAmount = $(this).find(‘p span:nth-child(1)’).text().split(“₹…

Laravel 5.8 Creating default object from empty value

When I try to update a record, I get an ErrorException “Creating default object from empty value” and points to my controller to $products->name = $request->input(‘name’) line. ProductController public function update(Request $request, $id) { $products = Product::find($id); $products->name = $request->input(‘name’); $products->category_id = $request->select(‘category_id’); $products->description = $request->input(‘description’); $products->price_neto = $request->input(‘price_neto’); $products->iva = $request->input(‘iva’); $products->price_total = $request->input(‘price_total’);…

I can not execute MyCommand in laravel

I have create a command in laravel and when I execute it I found this error php artisan query:all ReflectionException : Class App\Services\QueryService does not exist … my code that I written to call service is <?php namespace App\Console\Commands; use App\Services\QueryService; use Illuminate\Console\Command; class QueryUnits extends Command { protected $signature = ‘query:all’; protected $description =…