Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<?php
namespace App\Http\Livewire\Profile;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
class TwoFactorMainPageCard extends Component
{
/**
* Indicates if two factor authentication is confirmed and active.
*
* @var bool
*/
public $enabled;
/**
* Mount the component.
*
* @return void
*/
public function mount()
{
$user = Auth::guard('web')->user();
// $this->enabled strictly means 2FA is fully confirmed in the DB
$this->enabled = $user && !empty($user->two_factor_confirmed_at);
}
/**
* Redirect the user to the admin settings page.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function redirectToSettings()
{
$route = '';
$anchor = '#two-factor-authentication-form';
if (session('activeProfileType') == 'App\Models\Organization') {
$route = 'profile.settings';
}
elseif (session('activeProfileType') == 'App\Models\Bank') {
$route = 'profile.bank.settings';
}
elseif (session('activeProfileType') == 'App\Models\Admin') {
$route = 'profile.admin.settings';
}
else {
$route = 'profile.user.settings';
}
// Generate the URL for the route and append the anchor
$url = route($route) . $anchor;
return redirect()->to($url);
}
/**
* Get the current user of the application.
*
* @return mixed
*/
public function getUserProperty()
{
return Auth::guard('web')->user();
}
/**
* Render the component.
*
* @return \Illuminate\View\View
*/
public function render()
{
return view('livewire.profile.two-factor-main-page-card');
}
}