コード例 #1
0
 /**
  * Run the database seeds.
  *
  * Create five Levels in order to start your Gamify app
  *
  * @return void
  */
 public function run()
 {
     DB::table('levels')->delete();
     foreach (range(0, 4) as $index) {
         \Gamify\Level::create(['name' => 'Level ' . $index, 'amount_needed' => $index * 10]);
     }
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param LevelCreateRequest $request
  *
  * @return \Illuminate\Http\Response
  */
 public function store(LevelCreateRequest $request)
 {
     Level::create($request->all());
     return redirect()->route('admin.levels.index')->with('success', trans('admin/level/messages.create.success'));
 }