Greetings All,
Grateful for the tidbits from these convo threads. I got my deployment to work after the following steps.
-
First and foremost, I zipped my project ( local server laravel/homestead, so to be clear I zipped my ~/code/[my project name] ).
-
Uploaded the zipped project file (via GoDaddy's C-Panel) to the root (/home/my username/) and expanded it, so my Laravel project is on the same level with 'public_html'. NOTE, maybe I did something wrong, but none of my .dot files were brought over. So I had to manually, from within GoDaddy's FileManager '+File' in the corresponding directories and create both my .htaccess and my .env file, then copy past the contents from my local files. I suspect that will apply to any other .dot file I may need .git for example if thats even needed ( haven't run into that problem yet though).
-
Here's where I think still needs improvement on my part. I then copied my entire public folder (from the newly expanded zip file) into the existing 'public_html' folder. I have seen advise from @lrobi2015 saying:
"I then delete the public_html dir and add a symlink to public in the laravel dir:
ln -s laravel/public public_html
and job done =) Cheers.."
Ok Great! Problem is, being that I am new to using Laravel's Framework and dealing with server side stuff manually, I had/still have no clue where the #$&% to perform/execute/paste the above symlink command. That said this is probably the correct thing to do as copying the contents of 'public' to 'public_html' is a violation of DRY (Do-not Repeat Yourself), plus the extra drama of having to code in 'public' and manually persist to 'public_html' is nonsensical. I a also not sure if when I figure this part out, If steps (4), (5) and (6) would still go as I have it, perhaps.
Finally (3) three file edits... since I haven't figured out the symlinks thing yet, I suppose.
-
.HTACCESS
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_URI} !^public_html // <--- included this line
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ public_html/$1 [L,R=301] // <--- spliced in 'public_html' here
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
-
AppServiceProvider (in the register method)
$this->app->bind('path.public_html', function() {
return DIR;
});
-
index.php. Amend the two lines below to reflect new folder structure IN THE index.php file under 'PUBLIC_HTML' not 'public':
⁃ require DIR.’/../[project name]/bootstrap/autoload.php';
⁃ $app = require_once DIR.'/../[project name]/bootstrap/app.php';
DONE!
Along the way here, I was getting the blank page, then I was getting a huge, site not secure warning, then since I maintained 'DEBUG true' I started getting standard Laravel errors implying path problems locating app.blade.php (happy moment, something I recognized). Step 5 was actually the last thing I did during this journey and now my Site WORKS!!!....... so far.
I really hope this helps someone, and hey @JeffreyWay and @TaylorOtwell, I know this is a business (Laravel / Laracasts) however you guys have already been deemed as the Monks Of Code for all who use PHP, therefore not having some kind of lesson for newbies on how to do this is not cool (forgive me if I missed it, searched Laracasts + Googled extensively. No disrespect to your Forge utility, but some of us aren't doing enough volume yet to play with the big boys and fork out the $240 or thereabouts per year for that service. Love you guys I'm just saying, can't inspire the world and leave us hanging thats very Basquiat/Kurt Cobain'ish of you. LOL.