
How to upload local Laravel project to server ?
To upload the laravel local project to server you have to first check the node_modules directory and dist directory in public folder and vendor directory exist or not. Before uploading files to server check the all important files (node_modules, vendor, public/dist, vendor/autoload.php) which is required to run application properly.
If thery are not available then please run composer install
command to generate the vendor folder, npm install
and npm run build
to generate the node_modules and public/dist folder and also run composer dump-autoload
if autoload.php file is not available in vendor directory.
Create database on server and import data from local development environment.
Compress local laravel project to zip file and upload to server (public_html)
Make changes for database and others configuration details to your .env file
APP_URL=http://domain.com
DB_DATABASE=database_name
DB_USERNAME=database_username
DB_PASSWORD=database_password
Create a .htaccess file on project root directory and place below code in it.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization MemberHeader
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Now you can visit you website. Hope it works for you.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- How to validate website url in laravel using validaiton
- How to create belongstomany relation using custom name on custom pivot table
- How to create project_user pivot table in laravel
- Laravel form request validation
- How to get path from current URL in Laravel
- How to create event and listener in laravel ?
- External link not working in laravel blade
- How to create controller in laravel
- Extra Filter Query on Relationships in Laravel
- How to upload image in laravel 8
- Wheredate in laravel not working
- Sample configuration files to create laravel project with docker using wsl (window subsystem linux)
- How to pass data to route in laravel?
- How to get date from created_at field in laravel
- Touch parent updated_at in Laravel
- Show old value while editing the form in Laravel
- Insert Comma Separated Values in laravel
- SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.post_id' in 'where clause
- Call to undefined relationship [user] on model [App\Models\Post]
- Laravel URL validation not working
- InRandomOrder() method with example in laravel
- Laravel pagination links with query string
- How to Get records between two dates in Laravel
- Ajax GET request in laravel
- Target class [App\Http\Controllers\Auth\Request] does not exist.