3 namespace App\Http\Controllers;
5 use App\Models\AlttpSeed;
6 use Illuminate\Http\Request;
7 use Illuminate\Support\Facades\Artisan;
9 class AlttpSeedController extends Controller
12 public function byHash($hash) {
13 $seed = AlttpSeed::where('hash', '=', $hash)->firstOrFail();
16 $seed->makeHidden('seed');
19 $seed->makeHidden('settings');
22 return $seed->toJson();
25 public function retry($hash) {
26 $seed = AlttpSeed::where('hash', '=', $hash)->firstOrFail();
28 if ($seed->status == 'error') {
29 $seed->status = 'pending';
31 Artisan::call('alttp:generate '.intval($seed->id));
34 return $seed->toJson();