My Laravel app works in the private folder and I need to tell Laravel that the public path is different. Today I have upgraded a Laravel app from 4.2 to 5.0 and I can't find where we specify the public path since the paths.php file doesn't exist anymore in Laravel 5.0.
In laravel 4.2 we had the /bootstrap/paths.php
file:
/*
|--------------------------------------------------------------------------
| Public Path
|--------------------------------------------------------------------------
|
| The public path contains the assets for your web application, such as
| your JavaScript and CSS files, and also contains the primary entry
| point for web requests into these applications from the outside.
|
*/
'public' => __DIR__.'/../../../public_html',
I'm not used with the Laravel 5.0 folders structure yet, any help would be greatly appreciated.
The publicPath configuration option can be quite useful in a variety of scenarios. It allows you to specify the base path for all the assets within your application. There are a few use cases in real applications where this feature becomes especially neat.
Public Path The publicPath configuration option can be quite useful in a variety of scenarios. It allows you to specify the base path for all the assets within your application.
Public Path. The publicPath configuration option can be quite useful in a variety of scenarios. It allows you to specify the base path for all the assets within your application.
publicPath specifies the virtual directory in web server from where bundled file, app.js is going to get served up from. Keep in mind, the word server when using publicPath can be either webpack-dev-server or express server or other server that you can use with webpack.
What worked for me flawlessly was adding to public/index.php
the following three lines:
$app->bind('path.public', function() {
return __DIR__;
});
This was answered at Laracast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With