/** * Make changes to the database. * * @return void */ public function up() { Schema::table('modpacks', function ($table) { $table->boolean('hidden')->default(1); }); foreach (Modpack::all() as $modpack) { $modpack->hidden = false; $modpack->save(); } }
private function fetchModpacks() { if (Cache::has('modpacks') && empty($this->client) && empty($this->key)) { $modpacks = Cache::get('modpacks'); } else { $modpacks = Modpack::all(); if (empty($this->client) && empty($this->key)) { Cache::put('modpacks', $modpacks, 5); } } $response = array(); $response['modpacks'] = array(); foreach ($modpacks as $modpack) { if ($modpack->private == 1 || $modpack->hidden == 1) { if (isset($this->client)) { foreach ($this->client->modpacks as $pmodpack) { if ($pmodpack->id == $modpack->id) { $response['modpacks'][$modpack->slug] = $modpack->name; } } } else { if (isset($this->key)) { $response['modpacks'][$modpack->slug] = $modpack->name; } } } else { $response['modpacks'][$modpack->slug] = $modpack->name; } } $response['mirror_url'] = env('SOLDER_MIRROR_URL'); return $response; }