Category : performance

i have laravel project with a lot of packages and my composer.json "require": { "php": "^7.2", "brozot/laravel-fcm": "^1.3", "fideloper/proxy": "^4.0", "laravel/framework": "^6.2", "laravel/socialite": "^4.4", "laravel/tinker": "^1.0", "laravel/ui": "^1.1", "paypal/rest-api-sdk-php": "*", "propaganistas/laravel-phone": "^4.2", "yajra/laravel-datatables-oracle": "~9.0" }, will this slow my site ? Sourc..

Read more

I have laravel project with a lot of packages and my composer.json "require": { "php": "^7.2", "brozot/laravel-fcm": "^1.3", "fideloper/proxy": "^4.0", "laravel/framework": "^6.2", "laravel/socialite": "^4.4", "laravel/tinker": "^1.0", "laravel/ui": "^1.1", "paypal/rest-api-sdk-php": "*", "propaganistas/laravel-phone": "^4.2", "yajra/laravel-datatables-oracle": "~9.0" }, will this slow my site ? Sourc..

Read more

I am appending about five thousand record with jquery foreach loop but it takes king time sometimes browser crashed. $.each(data, function(index, consignment) { $(‘#consignment_table > tbody’).append(`<tr class="consignment-row"><td><label class="kt-checkbox kt-checkbox–single kt-checkbox–solid"> <input type="checkbox" class="kt-checkable check_con" name="check_consignment" data-id="${consignment.id}" value="${consignment.id}"> <span></span> </label></td><td>${consignment.id}</td><td>${$.trim(customer_name)}</td><td>${consignment.customer_reference}</td><td>${$.trim(delivery_name)}</td><td>${$.trim(delivery_suburb)}</td><td>${$.trim(delivery_postcode)}</td><td>${consignment.carton}</td><td>${consignment.pallet}</td><td>${consignment.space}</td><td>${consignment.weight}</td><td>${$.trim(run_sheet_name)}</td><td>${run_sheet_id}</td><td>${consignment.status}</td><td>${$.trim(delivery_run_name)}</td><td>${$.trim(getFormattedDate(consignment.delivery_date))}</td><td>${$.trim(getFormattedDate(consignment.required_delivery_date))}</td><td>${driver}</td><td>${vehicle}</td><td>${consignment.consignment_type}</td><td>${$.trim(consignment.product_types.name)}</td><td><a href="/consignments/show/${consignment.id}">View</a></td></tr>`); }); How I can improve this code. Sourc..

Read more

I found another topic about this issue but since I couldn’t an answer for my case I opened this topic again. An appended accessor makes very slow the response (about 30 seconds.).. I’ll try to explain with codes below.. My problematic eloquent model is : $machines = Machine::where($condition)->with([‘jobs’ => function ($query) { $query->orderBy(‘queue’, ‘asc’); },’jobs.part.image’, ..

Read more

I read the Laravel documentation about the query builder, however I can not figure this out: Current situation: My User Model has many upperCategories and my upperCategory Model has many subCategories. That is why I can do this: auth()->user()->upperCategories()->with(‘subCategories’)->get()->toArray(); Note that I am using eager loading for improved performance. This code is working fine. It ..

Read more

I was checking a part of my application in which I connect to elasticsearch host server and then I realized for every time the front-end sends an report request to my back-end I’m creating an instance of elasticsearch client class using the following code : $elasticClient = ClientBuilder::create()->setHosts($this->setHostsParams())->build(); Since our application sends about 20 requests ..

Read more

public function delete( ReportDetailRequest $request ) { $id = (int)$request->id; $customerRecord = CustomerInfo::find($id); $customerRecord->delete(); } I currently have the above in a laravel application where a DELETE request is sent to this controller. At the moment, as you can see, its very simple, but the query seems super slow. It comes back in postman in ..

Read more

I have custom code where I check request params for existing and make query to database with model Code public function search(Request $request) { $position = $request->get(“position”) ?? null; $location = $request->get(“location”) ?? null; $employment = $request->get(“employment”) ?? null; $jobsBy = null; $jobs = new Job; if($position) { $jobs = Job::where(‘title’, ‘LIKE’, ‘%’.$position.’%’); if($location) { ..

Read more