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
- Laravel get count with where condition
- How to avoid duplicate entries in pivot table in Laravel
- The use statement with non-compound name 'DB' has no effect
- How to get selected categories on edit record with Select2
- Laravel file size validation not working
- How to print form data in laravel
- How to Access Array in blade laravel
- How to insert ckeditor data into database in Laravel?
- Cast Array to an Object in Controller and then pass to view in laravel
- Get the post details if it has at least one comment in comments table
- How to create laravel project using jetstream
- Return view from route Laravel
- How to get id of next record in laravel
- How to access the nth object from Laravel collection object ?
- Array to string conversion laravel blade
- Method Illuminate\Events\Dispatcher::fire does not exist
- Delete file from amazon s3 bucket using Laravel
- How to display a specific word from a string in laravel
- How to send email in laravel
- Update if exist else insert new record in laravel
- How to create event and listener in laravel ?
- How to pass two variables in HREF in laravel
- Call to a member function getRelationExistenceQuery() on array in Laravel
- How to get data from two tables in laravel
- Post table seeder laravel 10