Level 1
It seems that your "bind" is too late maybe. Try to put your code in AppServiceProvider register()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hy,
in a shared hosting the public folder is public_html so w need to add in index.php
/*
|--------------------------------------------------------------------------
| Set the public path to this directory
|--------------------------------------------------------------------------
|
*/
$app->bind('path.public', function() {
return __DIR__;
});
but if we have a cron job that use public_path();
like sending mail in queue with attachment.
public_path() return public instead of public_html.
Please or to participate in this conversation.