Closed MohammaddReza closed 3 years ago
You should import the Timezone
class.
im using this class but still have an error. use App\Timezone;
You have to use JamesMills\LaravelTimezone\Timezone
now i have this error:
Non-static method JamesMills\LaravelTimezone\Timezone::convertToLocal() should not be called statically
im using vue (not blade) and i have to use this with api
this is my function:
public function getTimeAttribute(){
return Timezone::convertToLocal($this->created_at);
}
Sorry, my bad. The package offers a Facade. You should use this one.
So please replace use JamesMills\LaravelTimezone\Facades\Timezone
thank you this is work very well.
So the issue is fixed?
Sorry I'm late to review this @MohammaddReza.
Thank you very much @SamuelNitsche for taking the time to provide help and a solution.
Stay safe!
i want to use this command in my model like this:
but it returns this error: Class 'App\Timezone' not found