#### Category : debugging

I’ve just upgraded my (Windows 10 2004) system from PHP 7.4 to PHP 8.0.3. I did this by uninstalling then reinstalling XAMPP with the later version. I am developing a Laravel 8.0 application in VS Code v 1.55, and the application runs absolutely fine. However, every single namespace/use statement in every single .php file has ..

I’m trying to setup debugging environment for my laravel application following this guide Debugging Laravel application on VSCode However, all I get when I launch the debugger is a list of files displayed in Chrome, for some reason it is not launching index.php how do I fix this? Here’s my launch.json { // Use IntelliSense ..

As environment example working with Laravel… I’m feeling the need to have debug layers and have the chance to reveal backend info on the web UI So for example how are set some env variables under some circumstances, or what endpoints is my frontend app calling… What I was thinking is to create a conditional ..

Suppose I want to detect if a the file uploaded name contains ~, ! or @. I know I’m dead wrong with my attempts below so ow would I go about doing it the correct way (for the sake of good practice)? I’ve tried: str_contains($asset->getClientOriginalName(), "~", "!", "@"); and preg_match(‘/[^[email protected]]/’,$asset->getClientOriginalName()); Sourc..

Just deployed a new app to production and seeing a strange bug: One of the pages has a PHP error and throws an exception. Strangely, it’s a Symfony branded exception page (screenshot), different from the ones I’ve seen in Laravel before. Env file is already set to production environment and has APP_DEBUG=false. Does anyone know ..

Whenever I write dd($searchedItem); inside the filter function it displays: Note: (I know filter won’t display the entire list but we’ll assume there are 50 array indexes): array:3 [ "InventoryID" => 1 "Name" => "Instant$5 Amazon Gift Card" "Number" => "40, 171" ] Here’s my PHP: $inventoryList =$this->_inventoryRepository->getInventoriesWithNumbers(); $search =$request->get(‘search’); $searchedItems = .. Read more I can’t install Sentry as on the documentation said. I’ve followed the instruction on https://docs.sentry.io/platforms/php/guides/laravel/ but it doesn’t work When I execute the php artisan sentry:publish –dsn=https://[key].ingest.sentry.io/xxxx command, it always gives me this error What is wrong? Sourc.. Read more I just tried scanning one of my Laravel based project using sonarqube cloud. But it didn’t detect missing semicolans as an issue? Here is the code I tried. <?php namespace AppHttpControllers; use AppCity; use IlluminateHttpRequest; class CitiesController extends Controller { public function generateShareImage(Request$request) { echo "Testing sonarqube" try { if ($request->city_name) {$city = ..

I have a div with two tables. <div> <table> //tbl1 has 7 rows //collection 1 </table <table> //tbl1 has 21 rows //collection 2 </table> </div> How can I loop the entire div with data populated in the table rows using @foreach with the chunk() method? or you can suggest something else entirely that produces the ..

I have a div with two tables. <div> <table> //tbl1 has 7 rows //collection 1 </table <table> //tbl1 has 21 rows //collection 2 </table> </div> How can I loop the entire div with data populated in the table rows using @foreach with the chunk() method? or you can suggest something else entirely that produces the ..

I currently have 2 functions I’m working with. Originally, the fetchInventories() function didn’t require an argument because I’m fetching some query results I need to use which’s happening inside the getInventories() function. But down the line, I needed to make sure the query knows what’s the current page number so I have to pass $current_page .. Read more I want to use server breakpoints in Zend Studio to debug a Laravel application. However I am unable to find any documentation involving how to set up Zend Studio breakpoints to work with a Laravel application. The documentation for Zend Studio has information on utilizing breakpoints in the debug process, however this is only to .. Read more I am looking for a method to integrate server breakpoints in Zend Studio into my debugging workflow, however I am unable to find any documentation involving how to set up Zend Studio breakpoints to work with a Laravel application. The documentation for Zend Studio has information on utilizing breakpoints in the debug process, however this .. Read more I’m getting paginated values from a query that lives inside a repository. However, in my controller (snippet below) – I want to keep track of the current paginated page the user’s on and would like to display records if, say, the user’s on page 1, then get items 1-30. (30 entries will be the max .. Read more To see if there’s an n + 1 problem in my Laravel API, I want to see how many and which query statements were executed. I use barryvdh/laravel-debugbar to see the query statements on web.php routes but this doesn’t provide me the wanted info on api.php routes. Sourc.. Read more To start off, I run artis cache:clear && artis config:clear && artis view:clear && artis route:clear && artis clear-compiled && npm run dev && composer dump-autoload on my command line to compile all assets and begin working but…. I’m facing this weird issue where I need to run npm run watch so that my JS .. Read more In my controller, I have a partial list that’s taking in a variable called$profiles $response[‘partial’] = view(‘pages.tools.partials.list’, [ ‘profiles’ =>$profiles ] )->render(); How would I be able to correctly pass this $profiles variable onto another partial called listTwo?$response[‘partial’] = view(‘pages.tools.partials.listTwo’, [ ‘profiles’ => $profiles ] )->render(); I tried the above (obvious) way. .. Read more I`m using laravel v7.28 with telescope v3.5.1 in my multi-domain application. This is my third time i’m using it, and before it worked well. Now I’m done every step from this doc, and dont got any error. When i’m do simething like commands or requests, i can see result in telescope_entries table, and it looks .. Read more My React.js project and Laravel project are separated. I login as an authenticated user in Postman using this endpoint (http://127.0.0.1:8000/api/auth/login) I then upload a file using this (http://127.0.0.1:8000/api/auth/wall-of-fame) All works fine – user’s logged in and that logged in user can successfully upload a file to the db along with their user_id, email, and file_path. .. Read more My React.js project and Laravel project are separated. I login as an authenticated user in Postman using this endpoint (http://127.0.0.1:8000/api/auth/login) I then upload a file using this (http://127.0.0.1:8000/api/auth/wall-of-fame) All works fine – user’s logged in and that logged in user can successfully upload a file to the db along with their user_id, email, and file_path. .. Read more I have a Laravel and React.js project that of which are separate code bases. When I login in Postman with login endpoint followed by uploading name of the file with another endpoint (both of them POST requests), the filePath, email and user_id are stored successfully in the db. However, when I do try this on .. Read more im using method in my model to mutate a single response to my client when call product Laravel using this method name by default? /** * Returns product attributes data to use in the API response. * * @return IlluminateHttpResourcesJsonAnonymousResourceCollection */ public function getAttributes() { return ProductAttributeResource::collection($this->attributes); } debugger show this area: C:xampphtdocs…/…vendorlaravelframeworksrcIlluminateDatabaseEloquentConcernsHasAttributes.php:521 protected function ..