Skip to content
Advertisement

Tag: laravel

Call to a member function count() on null

When I’m going to add data an error appears “Call to a member function count() on null” View Controller rekap: but the data is successfully entered into the database, and what steps should I take to correct the error Answer error tells you that images or files or both variables are null, looks like you don’t use eager loading quick

problem lose class address when update composer 1 to 2

i have problem when install or update composer. When the composer is updated and generated, the autoload file for example autoload_classmap.php changes and no class or file is found. I do not know how to solve. Thanks for the help. composer.json file } and when update composer say: not found class App/ClearingHourTime class file is : Answer I think you

Laravel: Test not Using Mocked Method

I want getNumber to return 200 in the test case, but when I run the test and inspect the result with $response->dump() I can see that the mock is not overriding the method as it is showing array:1 [0 => 100]. What am I missing? Controller: Model: Test: I am using Laravel 8 and referencing this documentation: https://laravel.com/docs/8.x/mocking#mocking-objects Answer In

Livewire views not found after deployment

After deployment to Forge, my Laravel Livewire site is throwing out a server error. I am using Digital Ocean as well. In the Forge site logs it says that my livewire view can’t be found. The app works perfectly on local. Any ideas what to do? I have attempted these commands Here is the site logs pt.1 and pt.2 I

How to implement authentication & authorization between microservices & API Gateway using Laravel

I’m trying to implement authentication & authorization of users between my microservices and API Gateway.What I have now: API Gateway which can request to any microservice. User microservice – where I’m storing all users. laravel/passport implemented to authenticate user in this microservice. Works as it should be, login route returns token which I’m using to authenticate user in this microservice.

Laravel CURL – Passing a string to HTTP URL (Postfields)

I use Laravel 9 and the built-in method Http::withHeaders ($headers)->post($url, $data). In the $data variable, I pass the string that resulted from http_build_request with the “&” separator. But Laravel tries to make an array out of it and send data. The API service returns me an error. Please tell me how you can force Laravel to pass exactly a STRING(!),

How to check if predefined selected column is null is laravel

I have this code : I want to check if correctTime is null then dont show this data. I have tried ->whereNotNull(‘correctTime’) it is giving error say column not found. Answer Since its a derived column you have to use having clause, the best thing of the raw query is that you can use multiple types of operators such as

Advertisement