Laravel Course

For managing dependencies, Laravel uses Composer. Make sure you have a Composer installed on your system before you install Laravel.
- If you not have Composer installed, visit the following URL and download composer to install it on your system:
//getcomposer.org/download/

Installing Laravel in XAMPP

I use XAMPP for PHP-MySQL applications, so I install laravel in XAMPP.
I have XAMPP installed on Windows, in "E:/xampp/" folder.

1. To install Laravel, use composer in the CMD (Command Line Interface). To open the Command Line Interface in windows, press the Start button and write "cmd" in the search field.

2. In the command line interface window I navigate to the "E:/xampp/htdocs/" folder, where I want to create a Laravel project for tests, called "lrvt", I write this command, then press Enter:
composer create-project laravel/laravel lrvt dev-develop
In the "E:/xampp/htdocs/" directory, the composer will create a folder called "lrvt" with the Laravel framework, upcoming version. The "dev-develop" instruction specifies to install the next upcoming version, which is in development state.
To create a Laravel project with the current stable version, use the "–-prefer-dist" instruction:
composer create-project –-prefer-dist laravel/laravel project_name
- Or, just the "create-project" command, with nothing after the project_name (you can use any project name, i used "lrvt"):
composer create-project laravel/laravel project_name
At this point, I have a working installation of Laravel on the local host.

Testing Laravel project

To test the integrity of the installation with XAMPP, I start the XAMPP, then, in browser I go to:
localhost/lrvt/public/
It will display a page like in this image:
php artisan serve

- Alternatively, you can use the PHP's Built-in Web Server. In Command Line Interface navigate to the directory with Laravel project, then initialize the following instruction in command line interface:
php artisan serve
After executing the above command, you will see a screen as shown below:

php artisan serve
Now, point your browser to:
http://localhost:8000
- When you want to stop the server, press Ctrl-C.
If you want a port other than default 8000, just specify it with "--port" command.
php artisan serve --port=8080
If you get an error like: "RuntimeException No application encryption key has been specified.", you have to generate an APP_KEY in the ".env" file.
- If the root directory of your project doesn’t contain the .env file then rename the ".env.example" to ".env" file.
Execute the following command where you have installed Laravel.
php artisan key:generate
The newly generated key can be seen in the .env file.
If you use laravel on Linux /Unix system, set the write permission for the directory storage and bootstrap/cache.

To know the laravel installed version, run this command, with command line interface, in the directory where you installed laravel:
php artisan --version
Or, check it manually from the file:
your-project-folder/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

const VERSION = '5.5-dev'; //version of laravel

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
Laravel - Installation

Last accessed pages

  1. Mysql SELECT JOIN tables on two different Databases (4498)
  2. jQuery UI draggable - Drag elements (11448)
  3. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (142520)
  4. Using the Bone Tool (4253)
  5. Node.js Move and Copy Directory (20134)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (523)
  2. The Mastery of Love (65)
  3. CSS cursor property - Custom Cursors (62)
  4. Read Excel file data in PHP - PhpExcelReader (59)
  5. PHP-MySQL free course, online tutorials PHP MySQL code (44)