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 &...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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('<...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
php × 1467547mysql × 235618
javascript × 132271
html × 123834
laravel × 116750
jquery × 98728
wordpress × 88985
arrays × 72227
ajax × 66050
codeigniter × 52072
sql × 49378
json × 41025
symfony × 36891
laravel-5 × 34561
forms × 31943
regex × 30609
apache × 27296
database × 26696
.htaccess × 25002
mysqli × 24050
css × 23524
curl × 22605
pdo × 22169
woocommerce × 19258
session × 19243