Laravel installation and setup - ruipedrorijo/codenvy-tst-laravel GitHub Wiki
Laravel Tutorial
Composer Tool
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Laravel Installation
Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed:
laravel new blog
Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:
composer create-project --prefer-dist laravel/laravel blog
Run composer install
composer install downloads the dependencies you defined in composer.json in your vendor folder that you do not push to git. Artisan is part of the laravel package that's a dependency
Laravel - Application Structure
Laravel - Basic configuration
After installing Laravel, the first thing we need to do is to set the write permission for the directory storage and bootstrap/cache.
Generate Application key to secure session and other encrypted data. If the root directory doesn’t contain the .env file then rename the .env.example
to .env
file,mv .env.example .env
, and execute the following command php artisan key:generate
where you have installed Laravel. The newly generated key can be seen in the .env
file.
Local Development Server
If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the serve Artisan command. This command will start a development server at http://localhost:8000:
php artisan serve
Maintenance mode
php artisan down
to recover from maintenance mode
php artisan up
Laravel check version
php artisan --version