Reputation: 724
I am new to Laravel and started learning v5 few months back. I have created a sample application and want to deploy it over production (Shared hosting).
The easiest way for me is to put all content including app, vendor, config, tests etc folders directly to public_html but I don't want to do this. I want to keep laravel specific things outside the public_html and put only content from public folder to this directory.
What are the options available to do this?
Also, can I share same laravel installation for multiple applications?
Upvotes: 1
Views: 1015
Reputation: 1319
on public/index.php
add after
$app = require_once __DIR__.'/../bootstrap/app.php';
this:
$app->bind('path.public', function() {
return __DIR__;
});
Now You can change public
directory to public_html
Upvotes: 1
Reputation: 1035
Keep your code outside of the public_html
and create a symbolic link from public_html
to the public
directory in your laravel directory.
Upvotes: 0