Merge pull request #2854 from EnesSacid-Buker/master

Landing page not found issue
This commit is contained in:
Cüneyt Şentürk 2022-12-30 10:18:25 +03:00 committed by GitHub
commit 1333ecc2f2
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;