Im gonna tell you how to upload our laravel project by free hostinger (000webhost). First of all we have to sign up to 000webhost here.
Create new website.
Create new database.
Open our laravel project folder, and create new folder. Move all folder and files in our laravel project to new folder except public.
Make zip from public and new folder.
Upload our laravel project zip to 000webhost.
There will be 3 folder on our root, Public_html, laravel, and tmp.
Upload public zip to public folder and also laravel zip to laravel folder.
Extract both of zip and move files to correct path. Ater that open public_html/index.php and change loader script with correct path
$app = require_once __DIR__.’/../bootstrap/app.php’;
$app = require_once __DIR__.’/../laravel/bootstrap/app.php’;
then go to laravel/.env and change db name, db username, and also db password with our current db name on 000webhost.
after that go to laravel/config/database.php and change all data for database correctly as well
last step is change env key at laravel/config/app.php
from ‘key’ => env(‘APP_KEY’),
to ‘key’ => ‘your app key from .env file’,
then walah, your laravel project is ready with free hosting