Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RajSV's avatar
Level 1

Same PHP Code not working anymore

I have written a code to select a specific portion of the data from a table and display it in a new page. It was working fine before. All we did was introduced a new field and then reverted back. I am worried about the impact on the application due to these minor changes. I am using the following code:

public function chargeAwait(Request $request) { $createdDate = Carbon::now()->subDays(7)->toDateString(); $results = Chargeback::where('dispute_status', 'Disputed - Awaiting for Response') // ->whereDate('dispute_date','<=', $createdDate) ->where(function ($query) use ($createdDate) { $query->where(function ($subQuery) use ($createdDate) { $subQuery->where('action', 0) ->whereDate('dispute_date', '<=', $createdDate); }) ->orWhere(function ($subQuery) use ($createdDate) { $subQuery->where('action', 2) ->whereDate('dispute_date', '<=', $createdDate); }); }) // ->where('action',0)->orWhere('action',2) ->orderBy('dispute_date', 'desc')->paginate(pagination_limit()); return view('escalation.chargeawait', compact('results')); }

This code considers cases where dispute status is Disputed - Awaiting for Response and populates it in a new page of the application. It used to do that before. But the page is totally blank.

Any help would be appreciated.

Thanks Raj

0 likes
10 replies
jlrdw's avatar

Please format your code.

```
code
```

Backup before doing anything else is a suggestion.

Snapey's avatar

But the page is totally blank.

and you can't do any debugging?

RajSV's avatar
Level 1

It is small part of the code of a large controller.

I need to copy a lot of files and recreate the environment to an extent if I have to debug.

But, generally is the PHP with Laravel prone to such issues when changes are done. For ex: Changes in one part of the application impacts another part of the application.

Thanks Raj

jlrdw's avatar

@RajSV

For ex: Changes in one part of the application impacts another part of the application.

Of course it depends on what is changed.

If you change something in a function, of course the results may be different.

Even if you change a package, you need to view their change logs.

RajSV's avatar
Level 1

Ok, there is a another problem. I am trying to recreate a test environment on my local system. I have installed all the software (xampp, composer, laravel).

When I try to access a Route from the web.php, I am getting an error:

Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in C:\xampp\htdocs\index.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\index.php on line 6

I have tried a lot of suggestions from the web and I am still getting this error. Here is the code I have written:

tisuchi's avatar

@RajSV Did you install all of your composer dependencies?

For example running the following command in your project root:

composer install
RajSV's avatar
Level 1

Yes, I ran the composer install and Update commands. Still receiving that error.

Thanks

RajSV's avatar
Level 1

Thank you for the link to training. I am aware of the routing methods. I have tried a lot of things including re-installing the composer and laravel. I am working in the web.php file. Defined more routes. Now it is saying 404 "Not Found The requested URL was not found on this server."!!

One more thing, the welcome screen is no longer displayed when we type http://localhost. It just displays the folders located in the Project folder.

It does return the list of routes when I key in the command

php artisan route:list

What I am I doing wrong?

RajSV's avatar
Level 1

Finally, it worked!!!. It was a problem with the URL.

I tried entering localhost/public/AndtheRouteHere, and it worked.

Reinstall did the trick for original Facades\Route issue. But I am wondering why I need to enter Public in the URL? Anyway thans a bunch for the suggestions.

Please or to participate in this conversation.