34 lines
848 B
PHP
34 lines
848 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Wallet;
|
|
|
|
class WalletController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth:admin');
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$wallets = Wallet::with('user')->paginate(20);
|
|
return view('backend.pages.wallet.index', compact('wallets'));
|
|
}
|
|
|
|
public function settings()
|
|
{
|
|
return view('backend.pages.wallet.settings');
|
|
}
|
|
|
|
public function saveSettings(Request $request)
|
|
{
|
|
set_static_option('wallet_fee_percent', $request->wallet_fee_percent);
|
|
set_static_option('wallet_min_withdraw', $request->wallet_min_withdraw);
|
|
return back()->with(['msg' => 'Pengaturan wallet diperbarui', 'type' => 'success']);
|
|
}
|
|
}
|