I have column timezone in my brands table.I want to make timezone dynamic such as which brand is there that time zone should be applied.
public function handle($request, Closure $next)
{
$user = Auth::user();
$brandId = Auth::check() ? Auth::user()->brand : null;
// Fetch the brand
$brand = Brand::find($brandId); // You need to replace $brandId with the actual brand ID
// Set the timezone
if ($brand) {
Config::set('app.timezone', $brand->timezone);
}
}
I add this in my AdminAccess.php middleware but it is not storing exact timezone
New contributor
bhavika vasani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.