laravel-timezone icon indicating copy to clipboard operation
laravel-timezone copied to clipboard

Usage of protected instead of private function

Open oza75 opened this issue 4 years ago • 2 comments

https://github.com/jamesmills/laravel-timezone/blob/20ea12b088909c3dfadf6de8ae961c367a77b668/src/Timezone.php#L51

I'm wondering, if we can use protected instead of private function then people can easily extends the Timezone and customize to their need.

Also, Can we extract the obtaining of the time zone in another class which will be responsible for assigning the time zone to the user (the user could be passed in the constructor and if not then we will use the Auth::user() )?

This will allow us to assign the time zone to the user without necessarily listening to the authentication event. https://github.com/jamesmills/laravel-timezone/blob/20ea12b088909c3dfadf6de8ae961c367a77b668/src/Listeners/Auth/UpdateUsersTimezone.php#L50

oza75 avatar Dec 11 '20 14:12 oza75

I'm wondering, if we can use protected instead of private function then people can easily extends the Timezone and customize to their need.

@oza75 do you still require this?

jamesmills avatar Feb 21 '21 13:02 jamesmills

Can we extract the obtaining of the time zone in another class which will be responsible for assigning the time zone to the user

@oza75 I'm wondering if this https://github.com/jamesmills/laravel-timezone/pull/36 is going to help with that? It's still being worked on but I think we will release an update soon.

jamesmills avatar Feb 21 '21 13:02 jamesmills