3 Star 2 Fork 0

Kevin / laravel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
2014_03_27_144409_add_authors.php 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
Kevin 提交于 2014-03-29 23:35 . 表单提交入库代码是咧
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class AddAuthors extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::table('authors')->insert(array(
'name' => 'Kevin Hawk',
'bio' => 'Kevin Hawk is a really greate developer!',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
DB::table('authors')->insert(array(
'name' => 'Sandra',
'bio' => 'Sandra is a beautiful girl!',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
DB::table('authors')->insert(array(
'name' => 'Mark Twain',
'bio' => 'Mark Twain was a prominent American author of the 19th century.',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
DB::table('authors')->insert(array(
'name' => 'Martin',
'bio' => 'Martin is a really greate author!',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
DB::table('authors')->insert(array(
'name' => 'Jane Doe',
'bio' => 'Jane Doe is a really greate author!',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
DB::table('authors')->insert(array(
'name' => 'Bill Bo',
'bio' => 'Bill is lorem ipsum dolor sit amet, consectertur adipiscing elit!',
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::table('authors')->where('name', '=', 'Kevin Hawk')->delete();
DB::table('authors')->where('name', '=', 'Sandra')->delete();
DB::table('authors')->where('name', '=', 'Mark Twain')->delete();
DB::table('authors')->where('name', '=', 'Martin')->delete();
DB::table('authors')->where('name', '=', 'Jane Doe')->delete();
DB::table('authors')->where('name', '=', 'Bill Bo')->delete();
}
}
PHP
1
https://gitee.com/adin283/laravel.git
git@gitee.com:adin283/laravel.git
adin283
laravel
laravel
master

搜索帮助