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:
- 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:
- <VirtualHost *: 80>
- DocumentRoot "E:/www/project/public"
- ServerName laravel. dev
- ErrorLog "logs/laravel. log"
- CustomLog "logs/laravel. log" common
- </VirtualHost>
Of course, you also need to bind the domain name in your hosts:
- 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:
- Route: get ('test', function ()
- {
- Return 'Hello World! ';
- });
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 .*"