ability to slam all settings into one database
This commit is contained in:
parent
16eebcb02a
commit
63888f11e5
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace App\Classes;
|
namespace App\Classes;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\Egg;
|
use App\Models\Egg;
|
||||||
use App\Models\Nest;
|
use App\Models\Nest;
|
||||||
use App\Models\Node;
|
use App\Models\Node;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use App\Models\Settings;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Client\PendingRequest;
|
use Illuminate\Http\Client\PendingRequest;
|
||||||
use Illuminate\Http\Client\Response;
|
use Illuminate\Http\Client\Response;
|
||||||
|
@ -141,7 +141,7 @@ class Pterodactyl
|
||||||
*/
|
*/
|
||||||
public static function getAllocations(Node $node)
|
public static function getAllocations(Node $node)
|
||||||
{
|
{
|
||||||
$per_page = Configuration::getValueByKey('ALLOCATION_LIMIT', 200);
|
$per_page = Settings::getValueByKey('SETTINGS::SERVER:ALLOCATION_LIMIT', 200);
|
||||||
try {
|
try {
|
||||||
$response = self::client()->get("/application/nodes/{$node->id}/allocations?per_page={$per_page}");
|
$response = self::client()->get("/application/nodes/{$node->id}/allocations?per_page={$per_page}");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Admin;
|
|
||||||
|
|
||||||
use App\Models\Configuration;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
|
|
||||||
class ConfigurationController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @param Request $request
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
|
||||||
public function updatevalue(Request $request)
|
|
||||||
{
|
|
||||||
$configuration = Configuration::findOrFail($request->input('key'));
|
|
||||||
|
|
||||||
$request->validate([
|
|
||||||
'key' => 'required|string|max:191',
|
|
||||||
'value' => 'required|string|max:191',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$configuration->update($request->all());
|
|
||||||
|
|
||||||
return redirect()->route('admin.settings.index')->with('success', __('configuration has been updated!'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param Configuration $configuration
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function destroy(Configuration $configuration)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function datatable()
|
|
||||||
{
|
|
||||||
$query = Configuration::query();
|
|
||||||
|
|
||||||
return datatables($query)
|
|
||||||
->addColumn('actions', function (Configuration $configuration) {
|
|
||||||
return '<button data-content="' . __("Edit") . '" data-toggle="popover" data-trigger="hover" data-placement="top" onclick="configuration.parse(\'' . $configuration->key . '\',\'' . $configuration->value . '\',\'' . $configuration->type . '\')" data-content="Edit" data-trigger="hover" data-toggle="tooltip" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></button> ';
|
|
||||||
})
|
|
||||||
->editColumn('created_at', function (Configuration $configuration) {
|
|
||||||
return $configuration->created_at ? $configuration->created_at->diffForHumans() : '';
|
|
||||||
})
|
|
||||||
->rawColumns(['actions'])
|
|
||||||
->make();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,10 +4,10 @@ namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Events\UserUpdateCreditsEvent;
|
use App\Events\UserUpdateCreditsEvent;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\InvoiceSettings;
|
use App\Models\InvoiceSettings;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\CreditProduct;
|
use App\Models\CreditProduct;
|
||||||
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications\InvoiceNotification;
|
use App\Notifications\InvoiceNotification;
|
||||||
use App\Notifications\ConfirmPaymentNotification;
|
use App\Notifications\ConfirmPaymentNotification;
|
||||||
|
@ -167,9 +167,9 @@ class PaymentController extends Controller
|
||||||
$user->increment('credits', $creditProduct->quantity);
|
$user->increment('credits', $creditProduct->quantity);
|
||||||
|
|
||||||
//update server limit
|
//update server limit
|
||||||
if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
||||||
if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
||||||
$user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
$user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,9 +304,9 @@ class PaymentController extends Controller
|
||||||
$user->increment('credits', $creditProduct->quantity);
|
$user->increment('credits', $creditProduct->quantity);
|
||||||
|
|
||||||
//update server limit
|
//update server limit
|
||||||
if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
||||||
if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
||||||
$user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
$user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,9 +398,9 @@ class PaymentController extends Controller
|
||||||
$user->increment('credits', $payment->amount);
|
$user->increment('credits', $payment->amount);
|
||||||
|
|
||||||
//update server limit
|
//update server limit
|
||||||
if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
|
||||||
if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
|
||||||
$user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
$user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,10 @@
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Egg;
|
|
||||||
use App\Models\Location;
|
use App\Models\Location;
|
||||||
use App\Models\Nest;
|
use App\Models\Nest;
|
||||||
use App\Models\Node;
|
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
use App\Models\Settings;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
@ -16,7 +14,6 @@ use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
|
||||||
|
|
||||||
class ProductController extends Controller
|
class ProductController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -97,7 +94,7 @@ class ProductController extends Controller
|
||||||
{
|
{
|
||||||
return view('admin.products.show', [
|
return view('admin.products.show', [
|
||||||
'product' => $product,
|
'product' => $product,
|
||||||
'minimum_credits' => Configuration::getValueByKey("MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER"),
|
'minimum_credits' => Settings::getValueByKey("SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER"),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\SettingsControllers;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\InvoiceSettings;
|
use App\Models\InvoiceSettings;
|
||||||
|
use App\Models\Settings;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
|
@ -85,4 +86,44 @@ class SettingsController extends Controller
|
||||||
return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
|
return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updatevalue(Request $request)
|
||||||
|
{
|
||||||
|
$setting = Settings::findOrFail($request->input('key'));
|
||||||
|
|
||||||
|
$request->validate([
|
||||||
|
'key' => 'required|string|max:191',
|
||||||
|
'value' => 'required|string|max:191',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$setting->update($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('admin.settings.index')->with('success', __('configuration has been updated!'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param Settings $setting
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function destroy(Settings $setting)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datatable()
|
||||||
|
{
|
||||||
|
$query = Settings::query();
|
||||||
|
|
||||||
|
return datatables($query)
|
||||||
|
->addColumn('actions', function (Settings $setting) {
|
||||||
|
return '<button data-content="' . __("Edit") . '" data-toggle="popover" data-trigger="hover" data-placement="top" onclick="configuration.parse(\'' . $setting->key . '\',\'' . $setting->value . '\',\'' . $setting->type . '\')" data-content="Edit" data-trigger="hover" data-toggle="tooltip" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></button> ';
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Settings $setting) {
|
||||||
|
return $setting->created_at ? $setting->created_at->diffForHumans() : '';
|
||||||
|
})
|
||||||
|
->rawColumns(['actions'])
|
||||||
|
->make();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@ namespace App\Http\Controllers\Api;
|
||||||
use App\Classes\Pterodactyl;
|
use App\Classes\Pterodactyl;
|
||||||
use App\Events\UserUpdateCreditsEvent;
|
use App\Events\UserUpdateCreditsEvent;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\DiscordUser;
|
use App\Models\DiscordUser;
|
||||||
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||||
|
@ -180,8 +180,8 @@ class UserController extends Controller
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'name' => $request->input('name'),
|
'name' => $request->input('name'),
|
||||||
'email' => $request->input('email'),
|
'email' => $request->input('email'),
|
||||||
'credits' => Configuration::getValueByKey('INITIAL_CREDITS', 150),
|
'credits' => Settings::getValueByKey('SETTINGS::USER:INITIAL_CREDITS', 150),
|
||||||
'server_limit' => Configuration::getValueByKey('INITIAL_SERVER_LIMIT', 1),
|
'server_limit' => Settings::getValueByKey('SETTINGS::USER:INITIAL_SERVER_LIMIT', 1),
|
||||||
'password' => Hash::make($request->input('password')),
|
'password' => Hash::make($request->input('password')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App\Classes\Pterodactyl;
|
use App\Classes\Pterodactyl;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Configuration;
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Providers\RouteServiceProvider;
|
use App\Providers\RouteServiceProvider;
|
||||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||||
|
@ -53,7 +53,7 @@ class RegisterController extends Controller
|
||||||
*/
|
*/
|
||||||
protected function validator(array $data)
|
protected function validator(array $data)
|
||||||
{
|
{
|
||||||
if (Configuration::getValueByKey('REGISTER_IP_CHECK', 'true') == 'true') {
|
if (Settings::getValueByKey('SETTINGS::SYSTEM:REGISTER_IP_CHECK', 'true') == 'true') {
|
||||||
|
|
||||||
//check if ip has already made an account
|
//check if ip has already made an account
|
||||||
$data['ip'] = session()->get('ip') ?? request()->ip();
|
$data['ip'] = session()->get('ip') ?? request()->ip();
|
||||||
|
@ -90,8 +90,8 @@ class RegisterController extends Controller
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'email' => $data['email'],
|
'email' => $data['email'],
|
||||||
'credits' => Configuration::getValueByKey('INITIAL_CREDITS', 150),
|
'credits' => Settings::getValueByKey('SETTINGS::USER:INITIAL_CREDITS', 150),
|
||||||
'server_limit' => Configuration::getValueByKey('INITIAL_SERVER_LIMIT', 1),
|
'server_limit' => Settings::getValueByKey('SETTINGS::USER:INITIAL_SERVER_LIMIT', 1),
|
||||||
'password' => Hash::make($data['password']),
|
'password' => Hash::make($data['password']),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\DiscordUser;
|
use App\Models\DiscordUser;
|
||||||
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Voucher;
|
use App\Models\Voucher;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
@ -40,8 +40,8 @@ class SocialiteController extends Controller
|
||||||
//create discord user in db
|
//create discord user in db
|
||||||
DiscordUser::create(array_merge($discord->user, ['user_id' => Auth::user()->id]));
|
DiscordUser::create(array_merge($discord->user, ['user_id' => Auth::user()->id]));
|
||||||
//update user
|
//update user
|
||||||
Auth::user()->increment('credits', Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD'));
|
Auth::user()->increment('credits', Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD'));
|
||||||
Auth::user()->increment('server_limit', Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD'));
|
Auth::user()->increment('server_limit', Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD'));
|
||||||
Auth::user()->update(['discord_verified_at' => now()]);
|
Auth::user()->update(['discord_verified_at' => now()]);
|
||||||
} else {
|
} else {
|
||||||
$user->discordUser->update($discord->user);
|
$user->discordUser->update($discord->user);
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Egg;
|
|
||||||
use App\Models\Product;
|
|
||||||
use App\Models\UsefulLink;
|
use App\Models\UsefulLink;
|
||||||
use App\Models\Configuration;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Contracts\View\Factory;
|
|
||||||
use Illuminate\Contracts\View\View;
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
@ -19,9 +16,9 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
return view('profile.index')->with([
|
return view('profile.index')->with([
|
||||||
'user' => Auth::user(),
|
'user' => Auth::user(),
|
||||||
'credits_reward_after_verify_discord' => Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD'),
|
'credits_reward_after_verify_discord' => Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD'),
|
||||||
'force_email_verification' => Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION'),
|
'force_email_verification' => Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION'),
|
||||||
'force_discord_verification' => Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION'),
|
'force_discord_verification' => Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Classes\Pterodactyl;
|
use App\Classes\Pterodactyl;
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\Egg;
|
use App\Models\Egg;
|
||||||
use App\Models\Location;
|
use App\Models\Location;
|
||||||
use App\Models\Nest;
|
use App\Models\Nest;
|
||||||
use App\Models\Node;
|
use App\Models\Node;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use App\Models\Settings;
|
||||||
use App\Notifications\ServerCreationError;
|
use App\Notifications\ServerCreationError;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
@ -107,7 +107,7 @@ class ServerController extends Controller
|
||||||
if (
|
if (
|
||||||
Auth::user()->credits <
|
Auth::user()->credits <
|
||||||
($product->minimum_credits == -1
|
($product->minimum_credits == -1
|
||||||
? Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
? Settings::getValueByKey('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
||||||
: $product->minimum_credits)
|
: $product->minimum_credits)
|
||||||
) {
|
) {
|
||||||
return redirect()->route('servers.index')->with('error', "You do not have the required amount of " . CREDITS_DISPLAY_NAME . " to use this product!");
|
return redirect()->route('servers.index')->with('error', "You do not have the required amount of " . CREDITS_DISPLAY_NAME . " to use this product!");
|
||||||
|
@ -115,12 +115,12 @@ class ServerController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
//Required Verification for creating an server
|
//Required Verification for creating an server
|
||||||
if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', 'false') === 'true' && !Auth::user()->hasVerifiedEmail()) {
|
if (Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION', 'false') === 'true' && !Auth::user()->hasVerifiedEmail()) {
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server."));
|
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server."));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Required Verification for creating an server
|
//Required Verification for creating an server
|
||||||
if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) {
|
if (Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) {
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server."));
|
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ class ServerController extends Controller
|
||||||
'identifier' => $serverAttributes['identifier']
|
'identifier' => $serverAttributes['identifier']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (Configuration::getValueByKey('SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') {
|
if (Settings::getValueByKey('SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') {
|
||||||
if ($request->user()->credits >= $server->product->getHourlyPrice()) {
|
if ($request->user()->credits >= $server->product->getHourlyPrice()) {
|
||||||
$request->user()->decrement('credits', $server->product->getHourlyPrice());
|
$request->user()->decrement('credits', $server->product->getHourlyPrice());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\CreditProduct;
|
use App\Models\CreditProduct;
|
||||||
|
use App\Models\Settings;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class StoreController extends Controller
|
class StoreController extends Controller
|
||||||
|
@ -20,12 +20,12 @@ class StoreController extends Controller
|
||||||
) $isPaymentSetup = true;
|
) $isPaymentSetup = true;
|
||||||
|
|
||||||
//Required Verification for creating an server
|
//Required Verification for creating an server
|
||||||
if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) {
|
if (Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) {
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can purchase credits."));
|
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can purchase credits."));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Required Verification for creating an server
|
//Required Verification for creating an server
|
||||||
if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', false) === 'true' && !Auth::user()->discordUser) {
|
if (Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', false) === 'true' && !Auth::user()->discordUser) {
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can purchase Credits"));
|
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can purchase Credits"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
use App\Models\Configuration;
|
||||||
|
use App\Models\Settings;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ class GlobalNames
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
define('CREDITS_DISPLAY_NAME' , Configuration::getValueByKey('CREDITS_DISPLAY_NAME' , 'Credits'));
|
define('CREDITS_DISPLAY_NAME' , Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME' , 'Credits'));
|
||||||
|
|
||||||
$unsupported_lang_array = explode(',', config("app.unsupported_locales"));
|
$unsupported_lang_array = explode(',', config("app.unsupported_locales"));
|
||||||
$unsupported_lang_array = array_map( 'strtolower', $unsupported_lang_array );
|
$unsupported_lang_array = array_map( 'strtolower', $unsupported_lang_array );
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
namespace App\Listeners;
|
namespace App\Listeners;
|
||||||
|
|
||||||
use App\Events\UserUpdateCreditsEvent;
|
use App\Events\UserUpdateCreditsEvent;
|
||||||
use App\Models\Configuration;
|
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use App\Models\Settings;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
|
|
||||||
class UnsuspendServers implements ShouldQueue
|
class UnsuspendServers implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
@ -20,7 +19,7 @@ class UnsuspendServers implements ShouldQueue
|
||||||
*/
|
*/
|
||||||
public function handle(UserUpdateCreditsEvent $event)
|
public function handle(UserUpdateCreditsEvent $event)
|
||||||
{
|
{
|
||||||
if ($event->user->credits > Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER' , 50)){
|
if ($event->user->credits > Settings::getValueByKey('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER' , 50)){
|
||||||
/** @var Server $server */
|
/** @var Server $server */
|
||||||
foreach ($event->user->servers as $server){
|
foreach ($event->user->servers as $server){
|
||||||
if ($server->isSuspended()) $server->unSuspend();
|
if ($server->isSuspended()) $server->unSuspend();
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
namespace App\Listeners;
|
namespace App\Listeners;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
use App\Models\Settings;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
|
|
||||||
class Verified
|
class Verified
|
||||||
{
|
{
|
||||||
|
@ -26,7 +24,7 @@ class Verified
|
||||||
*/
|
*/
|
||||||
public function handle($event)
|
public function handle($event)
|
||||||
{
|
{
|
||||||
$event->user->increment('server_limit' , Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL'));
|
$event->user->increment('server_limit' , Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL'));
|
||||||
$event->user->increment('credits' , Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL'));
|
$event->user->increment('credits' , Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ class CreditProduct extends Model
|
||||||
*/
|
*/
|
||||||
public function getTaxPercent()
|
public function getTaxPercent()
|
||||||
{
|
{
|
||||||
$tax = Configuration::getValueByKey("SALES_TAX");
|
$tax = Settings::getValueByKey("SETTINGS::PAYMENTS:SALES_TAX");
|
||||||
return $tax < 0 ? 0 : $tax;
|
return $tax < 0 ? 0 : $tax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class Configuration extends Model
|
class Settings extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
public const CACHE_TAG = 'configuration';
|
public const CACHE_TAG = 'setting';
|
||||||
|
|
||||||
public $primaryKey = 'key';
|
public $primaryKey = 'key';
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ class Configuration extends Model
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
|
|
||||||
static::updated(function (Configuration $configuration) {
|
static::updated(function (Settings $settings) {
|
||||||
Cache::forget(self::CACHE_TAG .':'. $configuration->key);
|
Cache::forget(self::CACHE_TAG .':'. $settings->key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ class Configuration extends Model
|
||||||
public static function getValueByKey(string $key, $default = null)
|
public static function getValueByKey(string $key, $default = null)
|
||||||
{
|
{
|
||||||
return Cache::rememberForever(self::CACHE_TAG .':'. $key, function () use ($default, $key) {
|
return Cache::rememberForever(self::CACHE_TAG .':'. $key, function () use ($default, $key) {
|
||||||
$configuration = self::find($key);
|
$settings = self::find($key);
|
||||||
return $configuration ? $configuration->value : $default;
|
return $settings ? $settings->value : $default;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace App\Notifications;
|
namespace App\Notifications;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Notifications;
|
namespace App\Notifications;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
use App\Models\Settings;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
@ -41,18 +41,18 @@ class WelcomeMessage extends Notification implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
|
||||||
$AdditionalLine = "";
|
$AdditionalLine = "";
|
||||||
if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) {
|
if(Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) {
|
||||||
$AdditionalLine .= "Verifying your e-mail address will grant you ".Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL')." additional " . Configuration::getValueByKey('CREDITS_DISPLAY_NAME') . ". <br />";
|
$AdditionalLine .= "Verifying your e-mail address will grant you ".Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL')." additional " . Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ". <br />";
|
||||||
}
|
}
|
||||||
if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) {
|
if(Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) {
|
||||||
$AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ". <br />";
|
$AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ". <br />";
|
||||||
}
|
}
|
||||||
$AdditionalLine .="<br />";
|
$AdditionalLine .="<br />";
|
||||||
if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) {
|
if(Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) {
|
||||||
$AdditionalLine .= "You can also verify your discord account to get another " . Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . Configuration::getValueByKey('CREDITS_DISPLAY_NAME') . ". <br />";
|
$AdditionalLine .= "You can also verify your discord account to get another " . Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ". <br />";
|
||||||
}
|
}
|
||||||
if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) {
|
if(Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) {
|
||||||
$AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ". <br />";
|
$AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ". <br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $AdditionalLine;
|
return $AdditionalLine;
|
||||||
|
|
|
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateConfigurationsTable extends Migration
|
class Settings extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
|
@ -13,11 +13,12 @@ class CreateConfigurationsTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('configurations', function (Blueprint $table) {
|
Schema::create('settings', function (Blueprint $table) {
|
||||||
$table->string('key')->primary();
|
$table->id();
|
||||||
|
$table->string('key');
|
||||||
$table->string('value');
|
$table->string('value');
|
||||||
$table->string('type')->default('string');
|
$table->string('type');
|
||||||
$table->text('description')->nullable();
|
$table->string('description');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -29,6 +30,6 @@ class CreateConfigurationsTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('configurations');
|
Schema::dropIfExists('settings');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Database\Seeders\Seeds\ConfigurationSeeder;
|
use Database\Seeders\Seeds\SettingsSeeder;
|
||||||
use Database\Seeders\Seeds\InvoiceSettingsSeeder;
|
use Database\Seeders\Seeds\InvoiceSettingsSeeder;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class DatabaseSeeder extends Seeder
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$this->call([
|
$this->call([
|
||||||
ConfigurationSeeder::class,
|
SettingsSeeder::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
namespace Database\Seeders\Seeds;
|
namespace Database\Seeders\Seeds;
|
||||||
|
|
||||||
use App\Models\Configuration;
|
use App\Models\Settings;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class ConfigurationSeeder extends Seeder
|
class SettingsSeeder extends Seeder
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the database seeds.
|
* Run the database seeds.
|
||||||
|
@ -15,16 +15,16 @@ class ConfigurationSeeder extends Seeder
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
//initials
|
//initials
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'INITIAL_CREDITS',
|
'key' => 'SETTINGS::USER:INITIAL_CREDITS',
|
||||||
], [
|
], [
|
||||||
'value' => '250',
|
'value' => '250',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'The initial amount of credits the user starts with.'
|
'description' => 'The initial amount of credits the user starts with.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'INITIAL_SERVER_LIMIT',
|
'key' => 'SETTINGS::USER:NITIAL_SERVER_LIMIT',
|
||||||
], [
|
], [
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -32,16 +32,16 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//verify email event
|
//verify email event
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'CREDITS_REWARD_AFTER_VERIFY_EMAIL',
|
'key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL',
|
||||||
], [
|
], [
|
||||||
'value' => '250',
|
'value' => '250',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'Increase in credits after the user has verified their email account.'
|
'description' => 'Increase in credits after the user has verified their email account.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL',
|
'key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL',
|
||||||
], [
|
], [
|
||||||
'value' => '2',
|
'value' => '2',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -49,16 +49,16 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//verify discord event
|
//verify discord event
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'CREDITS_REWARD_AFTER_VERIFY_DISCORD',
|
'key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD',
|
||||||
], [
|
], [
|
||||||
'value' => '375',
|
'value' => '375',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
'description' => 'Increase in credits after the user has verified their discord account.'
|
'description' => 'Increase in credits after the user has verified their discord account.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD',
|
'key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD',
|
||||||
], [
|
], [
|
||||||
'value' => '2',
|
'value' => '2',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -66,8 +66,8 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//other
|
//other
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER',
|
'key' => 'SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER',
|
||||||
], [
|
], [
|
||||||
'value' => '50',
|
'value' => '50',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -75,8 +75,8 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//purchasing
|
//purchasing
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'SERVER_LIMIT_AFTER_IRL_PURCHASE',
|
'key' => 'SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE',
|
||||||
], [
|
], [
|
||||||
'value' => '10',
|
'value' => '10',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -85,16 +85,16 @@ class ConfigurationSeeder extends Seeder
|
||||||
|
|
||||||
|
|
||||||
//force email and discord verification
|
//force email and discord verification
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'FORCE_EMAIL_VERIFICATION',
|
'key' => 'SETTINGS::USER:FORCE_EMAIL_VERIFICATION',
|
||||||
], [
|
], [
|
||||||
'value' => 'false',
|
'value' => 'false',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'description' => 'Force an user to verify the email adress before creating a server / buying credits.'
|
'description' => 'Force an user to verify the email adress before creating a server / buying credits.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'FORCE_DISCORD_VERIFICATION',
|
'key' => 'SETTINGS::USER:FORCE_DISCORD_VERIFICATION',
|
||||||
], [
|
], [
|
||||||
'value' => 'false',
|
'value' => 'false',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
|
@ -102,8 +102,8 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//disable ip check on register
|
//disable ip check on register
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'REGISTER_IP_CHECK',
|
'key' => 'SETTINGS::SYSTEM:REGISTER_IP_CHECK',
|
||||||
], [
|
], [
|
||||||
'value' => 'true',
|
'value' => 'true',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
|
@ -111,8 +111,8 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//per_page on allocations request
|
//per_page on allocations request
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'ALLOCATION_LIMIT',
|
'key' => 'SETTINGS::SERVER:ALLOCATION_LIMIT',
|
||||||
], [
|
], [
|
||||||
'value' => '200',
|
'value' => '200',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
@ -120,8 +120,8 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//credits display name
|
//credits display name
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'CREDITS_DISPLAY_NAME',
|
'key' => 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME',
|
||||||
], [
|
], [
|
||||||
'value' => 'Credits',
|
'value' => 'Credits',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
|
@ -129,16 +129,16 @@ class ConfigurationSeeder extends Seeder
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//credits display name
|
//credits display name
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'SERVER_CREATE_CHARGE_FIRST_HOUR',
|
'key' => 'SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR',
|
||||||
], [
|
], [
|
||||||
'value' => 'true',
|
'value' => 'true',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'description' => 'Charges the first hour worth of credits upon creating a server.'
|
'description' => 'Charges the first hour worth of credits upon creating a server.'
|
||||||
]);
|
]);
|
||||||
//sales tax
|
//sales tax
|
||||||
Configuration::firstOrCreate([
|
Settings::firstOrCreate([
|
||||||
'key' => 'SALES_TAX',
|
'key' => 'SETTINGS::PAYMENTS:SALES_TAX',
|
||||||
], [
|
], [
|
||||||
'value' => '0',
|
'value' => '0',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content ">
|
<div class="modal-content ">
|
||||||
|
|
||||||
<form method="post" action="{{ route('admin.configurations.updatevalue') }}">
|
<form method="post" action="{{ route('admin.settings.updatevalue') }}">
|
||||||
@csrf
|
@csrf
|
||||||
@method('PATCH')
|
@method('PATCH')
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
stateSave: true,
|
stateSave: true,
|
||||||
ajax: "{{ route('admin.configurations.datatable') }}",
|
ajax: "{{ route('admin.settings.datatable') }}",
|
||||||
columns: [{
|
columns: [{
|
||||||
data: 'key'
|
data: 'key'
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use App\Http\Controllers\Admin\ActivityLogController;
|
use App\Http\Controllers\Admin\ActivityLogController;
|
||||||
use App\Http\Controllers\Admin\ApplicationApiController;
|
use App\Http\Controllers\Admin\ApplicationApiController;
|
||||||
use App\Http\Controllers\Admin\ConfigurationController;
|
|
||||||
use App\Http\Controllers\Admin\InvoiceController;
|
use App\Http\Controllers\Admin\InvoiceController;
|
||||||
use App\Http\Controllers\Admin\OverViewController;
|
use App\Http\Controllers\Admin\OverViewController;
|
||||||
use App\Http\Controllers\Admin\PaymentController;
|
use App\Http\Controllers\Admin\PaymentController;
|
||||||
|
@ -126,9 +125,9 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
|
||||||
Route::get('payments/datatable', [PaymentController::class, 'datatable'])->name('payments.datatable');
|
Route::get('payments/datatable', [PaymentController::class, 'datatable'])->name('payments.datatable');
|
||||||
Route::get('payments', [PaymentController::class, 'index'])->name('payments.index');
|
Route::get('payments', [PaymentController::class, 'index'])->name('payments.index');
|
||||||
|
|
||||||
#configuration
|
#settings
|
||||||
Route::get('configurations/datatable', [ConfigurationController::class, 'datatable'])->name('configurations.datatable');
|
Route::get('settings/datatable', [SettingsController::class, 'datatable'])->name('settings.datatable');
|
||||||
Route::patch('configurations/updatevalue', [ConfigurationController::class, 'updatevalue'])->name('configurations.updatevalue');
|
Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue');
|
||||||
|
|
||||||
#settings
|
#settings
|
||||||
Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons');
|
Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons');
|
||||||
|
|
Loading…
Reference in a new issue