public function run() { Notice::truncate(); $faker = Faker::create(); foreach (range(1, 50) as $index) { Notice::create(['title' => $faker->sentence(6), 'body' => $faker->realText(200, 2)]); } }
/** * Store a newly created notice in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Notice::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } Notice::create($data); return Redirect::route('notices.index'); }
public function run() { Notice::create(['title' => '通知通知', 'content' => '车尚车服务欢迎您,车尚车服务欢迎您,车尚车服务欢迎您']); }