Landing page not found issue fixed

If the landing page is not found redirect to dashboard
This commit is contained in:
EnesSacid-Buker 2022-12-30 10:08:14 +03:00 committed by GitHub
parent cb2ad9a2ad
commit 1c0c4b3e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
namespace App\Traits;
use App\Models\Auth\UserInvitation;
use Illuminate\Support\Facades\Route;
trait Users
{
@ -102,7 +103,9 @@ trait Users
return route('login');
}
$route_name = $user->isCustomer() ? 'portal.dashboard' : $user->landing_page;
$route_name = $user->isCustomer()
? 'portal.dashboard'
: (Route::has($user->landing_page) ? $user->landing_page : 'dashboard');
$company_id = company_id() ?: $this->getFirstCompanyOfUser()?->id;