/**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('builds', function ($table) {
         $table->string('minecraft_md5')->default('');
     });
     $minecraft = MinecraftUtils::getMinecraft(true);
     foreach (Build::all() as $build) {
         $build->minecraft_md5 = $minecraft[$build->minecraft]->md5;
         $build->save();
     }
 }
コード例 #2
0
 public function getCacheMinecraft()
 {
     if (Request::ajax()) {
         $reason = '';
         try {
             $reason = MinecraftUtils::getMinecraft(true);
         } catch (Exception $e) {
             return Response::json(array('status' => 'error', 'reason' => $e->getMessage()));
         }
         if (Cache::has('minecraftversions')) {
             return Response::json(array('status' => 'success', 'reason' => $reason));
         } else {
             return Response::json(array('status' => 'error', 'reason' => 'An unknown error has occured.'));
         }
     }
     return Response::view('errors.missing', array(), 404);
 }
コード例 #3
0
 public function getAddBuild($modpack_id)
 {
     $modpack = Modpack::find($modpack_id);
     if (empty($modpack)) {
         return Redirect::to('modpack/list')->withErrors(new MessageBag(array('Modpack not found')));
     }
     $minecraft = MinecraftUtils::getMinecraft();
     return View::make('modpack.build.create')->with(array('modpack' => $modpack, 'minecraft' => $minecraft));
 }