Skip to main content
4 votes
Accepted

Clarification on how PHP handles true and false values

What you are seeing is the result of "type juggling", where you have a variable which is a boolean, and you're using it somewhere you need a string. The rules for that are described in the &...
IMSoP's user avatar
  • 95.3k
2 votes

Laravel services, should we inject model classes or just use them with imports?

Since you are not going to use repository, then use it directly via import. As I understand it, services is used to handle business logic and repository is used to handle model data. In less complex ...
Azal's user avatar
  • 56
1 vote

MySQL docker container stuck reloading

The issue seems related to permission errors and the initialization of MySQL. Ensure that the files and directories mounted to the MySQL container have the correct permissions. Use chmod to set the ...
Aftab Ishfaq's user avatar
1 vote

Found suspicious codes, extracted login credentials from PNG file! (hacked wp)

It seems like your WordPress site has been compromised. This likely happened because a vulnerability allowed an attacker to inject malicious code into your wp-login.php file. The code you mentioned ...
Asllan Maciel's user avatar
1 vote

Clarification on how PHP handles true and false values

Why would PHP echo out false as true? It doesn't. false is echoed as an empty string. truevar in your output is the beginning of the second string that you echo, not the value of $falsevar. it would ...
Barmar's user avatar
  • 769k
1 vote

ERROR There are no commands defined in the "install" namespace

The command you are using is for Laravel 11. For Laravel 10.x, you can find your API enpoints in routes/api.php. To use an authenication token for your API scaffolding, you need to install Scantum. ...
JayDev95's user avatar
  • 930
1 vote

Options for using custom PHP in a wordpress site? No FTP access

If you have the WordPress login details, you can use the File Manager plugin to upload the files. But it's a little unsafe because if something goes wrong the website might go down so you need FTP ...
Yousuf Raza's user avatar
1 vote

How to filter my API requested events list properly?

Go check the API documentation, to see what parameters this endpoint takes. https://help.corsizio.com/article/39-api-get-events-list: order - String - Sort order to return the results list in. Can be ...
CBroe's user avatar
  • 95k
1 vote

How to output PDF string to a smaller portion of the page (or iframe)?

<iframe src="{{ route('your.pdf.route.name') }}"></iframe> and in your controller serving that route: public function index(Request $request) { $pdf = Browsershot::html('<...
5et's user avatar
  • 386
1 vote
Accepted

Laravel services, should we inject model classes or just use them with imports?

Both methods are valid, but in many cases, injecting the model provides a good balance of flexibility and maintainability, especially as your application grows. Ultimately, the choice depends on your ...
Jeyhun Rashidov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible