feat: update and dynamic profile for admin
This commit is contained in:
@@ -6,11 +6,20 @@ use Illuminate\Http\Request;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
//
|
||||
public function index()
|
||||
{
|
||||
$admin = auth('admin')->user();
|
||||
|
||||
if ($admin) {
|
||||
$registerTime = verta($admin->created_at)->format('Y/m/d');
|
||||
|
||||
return view('dashboard.profile', compact('admin', 'registerTime'));
|
||||
}
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
$registerTime = verta($user->created_at)->format('Y/m/d');
|
||||
return view('dashboard.profile' , compact('user' , 'registerTime'));
|
||||
|
||||
return view('dashboard.profile', compact('user', 'registerTime'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user