Notes for using phpartisanmigrate in laravel5.1-php Tutorial

Source: Internet
Author: User
This article mainly summarizes and introduces the precautions for using phpartisanmigrate in laravel5.1. This article is very detailed and has some reference and learning value for you to use phpartisanmigrate, let's take a look. This article mainly summarizes the precautions for using php artisan migrate in laravel 5.1. This article is very detailed and has some reference and learning value for you to use php artisan migrate, let's take a look.

PHP artisan migrateCommands are very important for laravel, but you need to pay attention to the following situations during use:

(1) create a new table in the migration folder and usephp artisan make:migrationStatement

Php artisan has powerful functions, so do not create a new table by yourself.

(2) use of composer dump-autoload

Composer dump-autoload is used to update the file vendor/composer/autoload_classmap.php. This file has many configurations and usesphp artisanThis file is called in advance. When you add a new table, run this command to use migrate. After deleting a table, use migrate: rollback and composer to delete the file.

Execute this statement to modify all files in the vendor/composer/folder in the laravel framework.

(3) install composer

It is possible that the command does not exist when you use composer. in this case, you must install composer.

  php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php  php composer-setup.php  php -r "unlink('composer-setup.php');"

Execute the first command to download the composer-setup.php script will simply detect php. if some parameters are not correctly set, a warning is given. download the latest version of composer. phar file to the current directory.

The functions of the preceding three commands are as follows:

  • Download the installation script (composer-setup.php) to the current directory.

  • Execute the installation process.

  • Delete the installation script -- composer-setup.php.

Global installation is to install Composer to the PATH included in the system environment variable PATH, and then you can directly execute the composer command in the command line window.

Mac or Linux: Open the command line window and run the following command to move the previously downloaded composer. phar file to the/usr/local/bin/directory:

sudo mv composer.phar /usr/local/bin/composer

The above is a detailed description of the precautions for using php artisan migrate in laravel 5.1. For more information, see other related articles in the first PHP community!

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.