Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Laravel Project Setup By VeeRa
- 1. Download Laravel Either Make Via Command Line
- [Download Laravel](https://github.com/laravel/laravel/tags)
- Command ```composer create-project --prefer-dist laravel/laravel my-laravel-app```
- ```composer create-project``` : Tells Composer to create a new project.
- ```--prefer-dist``` : Uses distribution archives (ZIP files) for faster installation.
- ```laravel/laravel``` : Specifies the Laravel starter project package.
- ```my-laravel-app``` : The name of the directory to create for your new Laravel project.
- 2. Open Project Folder And Open Currect Directory Command Terminal
- ```base
- cp .env.example .env
- ```
- Type Above Command For Copy .env File From .env.example
- 3. Add Two Files in Main Project Directory `index.php` And `.htaccess`
- File Name : ```index.php```
- ```php
- <?php
- /**
- * Laravel - A PHP Framework For Web Artisans
- *
- * @package Laravel
- * @author Taylor Otwell <taylor@laravel.com>
- */
- $uri = urldecode(
- parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
- );
- // This file allows us to emulate Apache's "mod_rewrite" functionality from the
- // built-in PHP web server. This provides a convenient way to test a Laravel
- // application without having installed a "real" web server software here.
- if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
- return false;
- }
- require_once __DIR__.'/public/index.php';
- ```
- File Name : ```.htaccess```
- ```
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} -d [OR]
- RewriteCond %{REQUEST_FILENAME} -f
- RewriteRule ^ ^$1 [N]
- RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
- RewriteRule ^(.*)$ public/$1
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^ index.php
- # Handle Authorization Header
- RewriteCond %{HTTP:Authorization} .
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
- </IfModule>
- ```
- 4. Add ```.htaccess``` in ```public``` Folder
- File Name : ```.htaccess```
- ```
- <IfModule mod_rewrite.c>
- <IfModule mod_negotiation.c>
- Options -MultiViews -Indexes
- </IfModule>
- RewriteEngine On
- # Handle Authorization Header
- 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]
- # Send Requests To Front Controller...
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^ index.php [L]
- </IfModule>
- ```
- 5. Install Composer Packages in Project Directory :
- ```bash
- composer install
- ```
- 6. Generate Laravel Application Key :
- ```bash
- php artisan key:generate
- ```
- 7. Clear Project Cache :
- ```bash
- php artisan migrate
- ```
- 8. Clear Project Cache :
- ```bash
- php artisan optimize:clear
- ```
- ```bash
- php artisan cache:clear
- ```
- ```bash
- php artisan config:cache
- ```
- ```bash
- php artisan config:clear
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement