Laravel 4 installation and entry graphic tutorial, laravel graphic

Source: Internet
Author: User

Laravel 4 installation and entry graphic tutorial, laravel graphic

1. Install Composer

First, you need to install Composer. Composer is a PHP dependency management tool. The Laravel framework uses Composer for installation and dependency management.
Note:
(1) If an error occurs while installing Composer, enable php_openssl and php_fileinfo extension in php. ini because Laravel needs.
(2) During the installation process, select the php.exe location of your instance.

Ii. Install Laravel

After the Composer installation is complete, run the following command on your website directory in cmd:

 
 
  1. Composer create-project laravel/laravel your-project-name


Composer automatically downloads and installs Laravel for you.


3. Deploy Virtual Hosts

For example, my project name is project:

 
 
  1. <VirtualHost *: 80>
  2. DocumentRoot "E:/www/project/public"
  3. ServerName laravel. dev
  4. ErrorLog "logs/laravel. log"
  5. CustomLog "logs/laravel. log" common
  6. </VirtualHost>


Of course, you also need to bind the domain name in your hosts:

 
 
  1. 127.0.0.1 laravel. dev


So far, the installation is complete:

4. Implement Hello World

Print Hello World through routing and add the following in app/routes. php:

 
 
  1. Route: get ('test', function ()
  2. {
  3. Return 'Hello World! ';
  4. });

Because the Laravel template uses Blade, the Controller or view is introduced in the following tutorial!


Laravel 41 automatically adds two more updated_at and created_at fields when saving () The database. How can I cancel this operation?

By default, Eloquent automatically maintains the created_at and updated_at fields in the data table. Simply add these timestamp fields to the table, and Eloquent will do the rest for you. If you do not want Eloquent to maintain these fields, add the following attributes to the model: public $ timestamps = false;

Reference: www.golaravel.com/docs/4.1/eloquent/?timestamps
 
How to view the sessionID of laravel4

We recommend that you install debugbar and use the following require in composer. json:
"Barryvdh/laravel-debugbar": "1 .*"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.