Home  >  Article  >  Backend Development  >  How to add a new field in Laravel, how to specify it after a certain field instead of adding it at the end

How to add a new field in Laravel, how to specify it after a certain field instead of adding it at the end

PHP中文网
PHP中文网Original
2016-08-04 09:20:451352browse

As shown in the picture: I want to add the city field to the items table, but the default is to add it to the end. How to specify that it is added to the location field in the items table?

As shown in the picture: I want to add the city field to the items table, but the default is to add it to the end. How to specify that it is added to the location field in the items table?

$table->string('city')->after('location');
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn