
Laravel 10 starter app using breeze on live server
In this tutorial, we will learn about how to create a Laravel 10 project using Breeze starter kit on live server step by step. To create the Laravel project you have to first login to your server using SSH command (ssh setz7b4duzpf@265.66.90.446
) and after entering command you have to enter the password in terminal. After successful login move to public_html directory using cd public_html
command.
1. Create Laravel project using composer create-project laravel/laravel .
command. This command will create laravel project in current directory (public_html).
composer create-project laravel/laravel .
2. Add configuration details (DB_DATABASE, DB_USERNAME, DB_PASSWORD, APP_URL, ASSET_URL) to .env file which exists in root directory of project. Please run cp .env.example .env
command if you did not found the .env file and enter the required details.
APP_URL=http://domain.com
DB_DATABASE=database_name
DB_USERNAME=database_username
DB_PASSWORD=database_password
3. Add laravel Breeze starter package using composer require command
composer require laravel/breeze --dev
4. Run php artisan breeze:install
command after composer require laravel/breeze --dev
.
After installing the Laravel Breeze package, run the following command. This will create authentication views, routes, controllers, and other resources for your application. When prompted, choose the first option (Blade) if you want to use Blade templates. You can select other options based on your requirements.
php artisan breeze:install
5. Run migration command and npm install and npm run build command to create tables in database, installing node packages and bundle the front-end assets, such as JavaScript and CSS files, into a production-ready format respectively.
php artisan migrate
npm install
npm run build
6. Create a .htaccess file in the root directory of your project and copy/paste 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 visit home page of your website. You will we able to visit your login and register page of website.
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 change default timestamp fields name in Laravel
- How to check find method executed successfully in laravel
- Rendering HTML from database table to view in Laravel
- Where to use whereNotNull eloquent in laravel
- Get comma separated email from input array
- External link not working in laravel blade
- Undefined property: stdClass::$title
- Insert dummy data in users table Laravel
- How to get laravel errors folder in views directory in laravel
- How to pass query string to url in laravel
- How to add active class to menu item in laravel
- How to fetch single row data from database in laravel
- Laravel save object to database
- Shorter syntax for whereHas with call back function in laravel
- How to insert value to additional columns in pivot table in laravel
- Display option of select as selected with blade directive Laravel
- Get posts belongs to a specific user in Laravel
- Post table seeder laravel 10
- Conditional validation in laravel
- How to prevent host header attack in Laravel
- How to display 1 day ago in comments in laravel view
- How to validate URL with https using regex in laravel
- Create model with migration and seeder
- How to fill a column automatically while creating records in Laravel
- Best Practices for Error Handling in Production Server Code (example code)