Changed to using new Address Model, Implemented Setup, Some minor CSS changes
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use App\Models\Domain;
|
||||
use App\Models\{Domain,Setup};
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -28,8 +29,34 @@ class HomeController extends Controller
|
||||
*
|
||||
* @note: Protected by Route
|
||||
*/
|
||||
public function setup()
|
||||
public function setup(Request $request)
|
||||
{
|
||||
return view('setup');
|
||||
$o = Setup::findOrNew(config('app.id'));
|
||||
|
||||
if ($request->post()) {
|
||||
$request->validate([
|
||||
'system_id' => 'required|exists:systems,id',
|
||||
'binkp' => 'nullable|array',
|
||||
'binkp.*' => 'nullable|numeric',
|
||||
'options' => 'nullable|array',
|
||||
'options.*' => 'nullable|numeric',
|
||||
]);
|
||||
|
||||
if (! $o->exists) {
|
||||
$o->id = config('app.id');
|
||||
$o->zmodem = 0;
|
||||
$o->emsi_protocols = 0;
|
||||
$o->protocols = 0;
|
||||
$o->permissions = 0;
|
||||
}
|
||||
|
||||
$o->binkp = collect($request->post('binkp'))->sum();
|
||||
$o->options = collect($request->post('options'))->sum();
|
||||
$o->system_id = $request->post('system_id');
|
||||
$o->save();
|
||||
}
|
||||
|
||||
return view('setup')
|
||||
->with('o',$o);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user