In this guide we will move files from localhost access to the https://khandana.nix.id/public domain.
Step 1 – By default, Laravel will access the folder root Laravel and not directly access the folder public belongs to him, so there needs to be a route so that when accessing the domain, direct access is directed to the file index.php what's in the folder public. Then how? now create index.php file in Laravel root folder.
The index.php file created in the Laravel root folder.
then fill it with the following script:
header('Location: public/'); “
Then save and make sure that when accessing the domain it will directly lead to the Laravel page.
Step 2 – The second step is to collect all Laravel files into one file by di-compress. So that it can be extracted directly in cPanel, use the .zip extension on the downloaded file.compress.
Compress Laravel files in Windows.
Step 3 – Then, please login first to cpanel. for tutorial login to cpanel how Click here
Step 4 – Then search for the File Manager feature, use the search field to make it easier to find the File Manager feature, then click the feature.
File Manager Features in cPanel
Step 5 – Upload the Laravel file and navigate to the folder that will be used for Laravel storage. In this example using the main folder public_html, so a local zip file is uploaded in that folder. You can upload the zip file to public_html or any other folder you will use to access Laravel files.
When the zip file is uploaded, right click the file and Extract, then all files will be in the folder public_html, as shown above.
Step 6 – Laravel file upload test results, Testing can be done by accessing the domain used to store Laravel files. And taraaa, the result will be like the image below.
That's the Laravel File Upload Guide to cPanel Hosting, I hope it's useful 😊😊.